Skip to content

Commit

Permalink
lowercasification
Browse files Browse the repository at this point in the history
note: bun shell keeps uppercase
  • Loading branch information
paperclover committed Jan 10, 2025
1 parent 6e273f8 commit 678dfeb
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion test/js/bun/http/fetch-file-upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/js/bun/io/bun-write.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions test/js/bun/spawn/spawn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});

Expand Down Expand Up @@ -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");
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/bun/test/stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 19 additions & 19 deletions test/js/node/fs/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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(
(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/js/web/fetch/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/web/fetch/fetch.unix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 678dfeb

Please sign in to comment.