1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 00:21:05 -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({ test({
name: "FileHandler with mode 'x' will throw if log file already exists", name: "FileHandler with mode 'x' will throw if log file already exists",
async fn() { async fn() {
await assertThrowsAsync( await assertThrowsAsync(async () => {
async () => { Deno.writeFileSync(LOG_FILE, new TextEncoder().encode("hello world"));
Deno.writeFileSync(LOG_FILE, new TextEncoder().encode("hello world")); const fileHandler = new FileHandler("WARNING", {
const fileHandler = new FileHandler("WARNING", { filename: LOG_FILE,
filename: LOG_FILE, mode: "x",
mode: "x", });
}); await fileHandler.setup();
await fileHandler.setup(); }, Deno.errors.AlreadyExists);
},
Deno.errors.AlreadyExists,
"ile exists"
);
Deno.removeSync(LOG_FILE); Deno.removeSync(LOG_FILE);
}, },
}); });