From 5ac54239d8763e4433fdb460c999d082b983c72e Mon Sep 17 00:00:00 2001 From: Ousama Ben Younes Date: Fri, 10 Apr 2026 10:51:34 +0000 Subject: [PATCH] fix: add context-generator.cjs to SHEBANG_SCRIPTS and assert file existence - Add missing context-generator.cjs to the SHEBANG_SCRIPTS list so CRLF regressions in that script are caught by the test suite - Replace silent early-returns with expect(existsSync(filePath)).toBe(true) so the suite fails loudly when expected build artifacts are absent Co-Authored-By: Claude --- tests/plugin-scripts-line-endings.test.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/plugin-scripts-line-endings.test.ts b/tests/plugin-scripts-line-endings.test.ts index d3a63872..7280dc0a 100644 --- a/tests/plugin-scripts-line-endings.test.ts +++ b/tests/plugin-scripts-line-endings.test.ts @@ -20,6 +20,7 @@ const SCRIPTS_DIR = join(import.meta.dir, '..', 'plugin', 'scripts'); const SHEBANG_SCRIPTS = [ 'mcp-server.cjs', 'worker-service.cjs', + 'context-generator.cjs', 'bun-runner.js', 'smart-install.js', 'worker-cli.js', @@ -30,10 +31,7 @@ describe('plugin/scripts line endings (#1342)', () => { const filePath = join(SCRIPTS_DIR, filename); it(`${filename} shebang line must not contain CRLF`, () => { - if (!existsSync(filePath)) { - // Skip if not yet built (CI may not have run the build step) - return; - } + expect(existsSync(filePath)).toBe(true); const content = readFileSync(filePath, 'binary'); const firstLine = content.split('\n')[0]; // CRLF would leave a trailing \r on the shebang line @@ -41,9 +39,7 @@ describe('plugin/scripts line endings (#1342)', () => { }); it(`${filename} must not contain any CRLF sequences`, () => { - if (!existsSync(filePath)) { - return; - } + expect(existsSync(filePath)).toBe(true); const content = readFileSync(filePath, 'binary'); expect(content.includes('\r\n')).toBe(false); });