fix bun-write test

This commit is contained in:
jhmaster2000
2023-12-11 14:11:31 -03:00
parent d1b04facce
commit 4befbc6a60

View File

@@ -452,9 +452,15 @@ describe("ENOENT", () => {
it("throws when given a file descriptor", async () => {
const file = Bun.file(123);
expect(async () => await Bun.write(file, "contents", { createPath: true })).rejects.toThrow(
"Cannot create a directory for a file descriptor",
);
if (process.env.BUN_POLYFILLS_TEST_RUNNER) {
expect(async () => await Bun.write(file, "contents", { createPath: true })).rejects.toThrow(
"Cannot create a directory for a file descriptor",
);
} else {
expect(async () => await Bun.write(file, "contents", { createPath: true })).toThrow(
"Cannot create a directory for a file descriptor",
);
}
});
});
});