diff --git a/test/js/bun/http/fetch-file-upload.test.ts b/test/js/bun/http/fetch-file-upload.test.ts index ae8a26a8706bd1..b779e3b6c55ae8 100644 --- a/test/js/bun/http/fetch-file-upload.test.ts +++ b/test/js/bun/http/fetch-file-upload.test.ts @@ -171,7 +171,7 @@ test("missing file throws the expected error", async () => { proxy: "http://localhost:3000", }); expect(Bun.peek.status(resp)).toBe("rejected"); - expect(async () => await resp).toThrow("No such file or directory"); + expect(async () => await resp).toThrow("no such file or directory"); } }); Bun.gc(true); diff --git a/test/js/bun/io/bun-write.test.js b/test/js/bun/io/bun-write.test.js index 18a744c3366f56..926ebba987fb5c 100644 --- a/test/js/bun/io/bun-write.test.js +++ b/test/js/bun/io/bun-write.test.js @@ -479,7 +479,7 @@ describe("ENOENT", () => { const file = join(dir, "file"); try { expect(async () => await Bun.write(file, "contents", { createPath: false })).toThrow( - "No such file or directory", + "no such file or directory", ); expect(fs.existsSync(file)).toBe(false); } finally { diff --git a/test/js/bun/spawn/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts index 4f2adf20356932..50e2c0142697ee 100644 --- a/test/js/bun/spawn/spawn.test.ts +++ b/test/js/bun/spawn/spawn.test.ts @@ -81,7 +81,7 @@ for (let [gcTick, label] of [ cmd: ["node", "-e", "console.log('hi')"], cwd: "./this-should-not-exist", }); - }).toThrow("No such file or directory"); + }).toThrow("no such file or directory"); }); }); @@ -525,7 +525,7 @@ for (let [gcTick, label] of [ cmd: ["node", "-e", "console.log('hi')"], cwd: "./this-should-not-exist", }); - }).toThrow("No such file or directory"); + }).toThrow("no such file or directory"); }); }); }); diff --git a/test/js/bun/test/stack.test.ts b/test/js/bun/test/stack.test.ts index 2a55d5b0e15974..da6dcf3edffe93 100644 --- a/test/js/bun/test/stack.test.ts +++ b/test/js/bun/test/stack.test.ts @@ -113,7 +113,7 @@ test("throwing inside an error suppresses the error and continues printing prope const { stderr, exitCode } = result; - expect(stderr.toString().trim()).toStartWith(`error: No such file or directory + expect(stderr.toString().trim()).toStartWith(`ENOENT: no such file or directory, open 'this-file-path-is-bad' path: "this-file-path-is-bad", syscall: "open", errno: -2, diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts index 86fc06de3080d7..5697c82f0e260a 100644 --- a/test/js/node/fs/fs.test.ts +++ b/test/js/node/fs/fs.test.ts @@ -584,8 +584,8 @@ describe("mkdirSync", () => { }); it("should throw ENOENT for empty string", () => { - expect(() => mkdirSync("", { recursive: true })).toThrow("No such file or directory"); - expect(() => mkdirSync("")).toThrow("No such file or directory"); + expect(() => mkdirSync("", { recursive: true })).toThrow("no such file or directory"); + expect(() => mkdirSync("")).toThrow("no such file or directory"); }); it("throws for invalid options", () => { @@ -673,7 +673,7 @@ it("promises.readFile", async () => { expect.unreachable(); } catch (e: any) { expect(e).toBeInstanceOf(Error); - expect(e.message).toBe("No such file or directory"); + expect(e.message).toBe("ENOENT: no such file or directory, open '/i-dont-exist'"); expect(e.code).toBe("ENOENT"); expect(e.errno).toBe(-2); expect(e.path).toBe("/i-dont-exist"); @@ -1004,10 +1004,10 @@ it("statSync throwIfNoEntry", () => { it("statSync throwIfNoEntry: true", () => { const path = join(tmpdirSync(), "does", "not", "exist"); - expect(() => statSync(path, { throwIfNoEntry: true })).toThrow("No such file or directory"); - expect(() => statSync(path)).toThrow("No such file or directory"); - expect(() => lstatSync(path, { throwIfNoEntry: true })).toThrow("No such file or directory"); - expect(() => lstatSync(path)).toThrow("No such file or directory"); + expect(() => statSync(path, { throwIfNoEntry: true })).toThrow("no such file or directory"); + expect(() => statSync(path)).toThrow("no such file or directory"); + expect(() => lstatSync(path, { throwIfNoEntry: true })).toThrow("no such file or directory"); + expect(() => lstatSync(path)).toThrow("no such file or directory"); }); it("stat == statSync", async () => { @@ -3279,20 +3279,20 @@ it("new Stats", () => { it("test syscall errno, issue#4198", () => { const path = `${tmpdir()}/non-existent-${Date.now()}.txt`; - expect(() => openSync(path, "r")).toThrow("No such file or directory"); - expect(() => readSync(2147483640, Buffer.alloc(1))).toThrow("Bad file descriptor"); - expect(() => readlinkSync(path)).toThrow("No such file or directory"); - expect(() => realpathSync(path)).toThrow("No such file or directory"); - expect(() => readFileSync(path)).toThrow("No such file or directory"); - expect(() => renameSync(path, `${path}.2`)).toThrow("No such file or directory"); - expect(() => statSync(path)).toThrow("No such file or directory"); - expect(() => unlinkSync(path)).toThrow("No such file or directory"); - expect(() => rmSync(path)).toThrow("No such file or directory"); - expect(() => rmdirSync(path)).toThrow("No such file or directory"); - expect(() => closeSync(2147483640)).toThrow("Bad file descriptor"); + expect(() => openSync(path, "r")).toThrow("no such file or directory"); + expect(() => readSync(2147483640, Buffer.alloc(1))).toThrow("bad file descriptor"); + expect(() => readlinkSync(path)).toThrow("no such file or directory"); + expect(() => realpathSync(path)).toThrow("no such file or directory"); + expect(() => readFileSync(path)).toThrow("no such file or directory"); + expect(() => renameSync(path, `${path}.2`)).toThrow("no such file or directory"); + expect(() => statSync(path)).toThrow("no such file or directory"); + expect(() => unlinkSync(path)).toThrow("no such file or directory"); + expect(() => rmSync(path)).toThrow("no such file or directory"); + expect(() => rmdirSync(path)).toThrow("no such file or directory"); + expect(() => closeSync(2147483640)).toThrow("bad file descriptor"); mkdirSync(path); - expect(() => mkdirSync(path)).toThrow("File or folder exists"); + expect(() => mkdirSync(path)).toThrow("file or folder exists"); expect(() => unlinkSync(path)).toThrow( ( { diff --git a/test/js/node/test/parallel/test-process-chdir-errormessage.js b/test/js/node/test/parallel/test-process-chdir-errormessage.js index 16cdf4aa1deaf3..0ed368287b377e 100644 --- a/test/js/node/test/parallel/test-process-chdir-errormessage.js +++ b/test/js/node/test/parallel/test-process-chdir-errormessage.js @@ -12,7 +12,7 @@ assert.throws( { name: 'Error', code: 'ENOENT', - // message: /ENOENT: No such file or directory, chdir .+ -> 'does-not-exist'/, + message: /ENOENT: no such file or directory, chdir .+ -> 'does-not-exist'/, path: process.cwd(), syscall: 'chdir', dest: 'does-not-exist' diff --git a/test/js/web/fetch/fetch.test.ts b/test/js/web/fetch/fetch.test.ts index 6c67d638598dc5..deb497aa19a4ac 100644 --- a/test/js/web/fetch/fetch.test.ts +++ b/test/js/web/fetch/fetch.test.ts @@ -909,7 +909,7 @@ describe("Bun.file", () => { forEachMethod(m => async () => { const file = Bun.file(path); - expect(async () => await file[m]()).toThrow("No such file or directory"); + expect(async () => await file[m]()).toThrow("no such file or directory"); }); }); }); diff --git a/test/js/web/fetch/fetch.unix.test.ts b/test/js/web/fetch/fetch.unix.test.ts index 3722a2c37275ff..c62ec91ed1f707 100644 --- a/test/js/web/fetch/fetch.unix.test.ts +++ b/test/js/web/fetch/fetch.unix.test.ts @@ -48,7 +48,7 @@ it("throws an error when the directory is not found", () => { return new Response("hello"); }, }), - ).toThrow("No such file or directory"); + ).toThrow("no such file or directory"); }); if (process.platform === "linux") {