From 87bbbd032f00bd327548259bb776e2326a072f47 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 08:48:51 +0000 Subject: [PATCH] Address review feedback in compile sourcemap tests - Use consistent .find(o => o.kind === "entry-point") pattern instead of outputs[0] - Remove fragile case-sensitive stderr error check (exitCode assertion suffices) - Fix misleading Bun.file(directory).exists() assertion to check actual file path https://claude.ai/code/session_01HsWNuNibpfh5s8oEMjc1Lx --- test/bundler/bun-build-compile-sourcemap.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/bundler/bun-build-compile-sourcemap.test.ts b/test/bundler/bun-build-compile-sourcemap.test.ts index 931f6e5201..c24651549d 100644 --- a/test/bundler/bun-build-compile-sourcemap.test.ts +++ b/test/bundler/bun-build-compile-sourcemap.test.ts @@ -139,7 +139,8 @@ main();`, expect(result.success).toBe(true); - const executablePath = result.outputs[0].path; + const executableOutput = result.outputs.find((o: any) => o.kind === "entry-point")!; + const executablePath = executableOutput.path; // No .map file should exist next to the executable expect(await Bun.file(`${executablePath}.map`).exists()).toBe(false); // No sourcemap outputs should be in the result @@ -233,7 +234,6 @@ export function greet() { const [_stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]); - expect(stderr).not.toContain("error"); expect(exitCode).toBe(0); // The executable should be at subdir/myapp @@ -249,9 +249,8 @@ export function greet() { expect(mapContent.version).toBe(3); expect(mapContent.mappings).toBeString(); - // The doubled path (subdir/subdir/) should NOT exist - const doubledSubdir = join(String(dir), "subdir", "subdir"); - expect(await Bun.file(doubledSubdir).exists()).toBe(false); + // Verify no .map was written into the doubled path subdir/subdir/ + expect(await Bun.file(join(String(dir), "subdir", "subdir", "myapp.map")).exists()).toBe(false); }); test("compile with multiple source files", async () => {