1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

fix(std): Fix FileHandler test with mode 'x' on non-English systems (#5757)

This commit is contained in:
Szalay Kristóf 2020-05-28 23:08:47 +02:00 committed by GitHub
parent 8f08b3f73d
commit c9f7558cd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,18 +115,14 @@ test({
test({
name: "FileHandler with mode 'x' will throw if log file already exists",
async fn() {
await assertThrowsAsync(
async () => {
Deno.writeFileSync(LOG_FILE, new TextEncoder().encode("hello world"));
const fileHandler = new FileHandler("WARNING", {
filename: LOG_FILE,
mode: "x",
});
await fileHandler.setup();
},
Deno.errors.AlreadyExists,
"ile exists"
);
await assertThrowsAsync(async () => {
Deno.writeFileSync(LOG_FILE, new TextEncoder().encode("hello world"));
const fileHandler = new FileHandler("WARNING", {
filename: LOG_FILE,
mode: "x",
});
await fileHandler.setup();
}, Deno.errors.AlreadyExists);
Deno.removeSync(LOG_FILE);
},
});