Skip to content

Commit

Permalink
fix: Fix FileHandler test with mode 'x' on non-English systems (denol…
Browse files Browse the repository at this point in the history
  • Loading branch information
littletof authored and caspervonb committed Jan 24, 2021
1 parent 24742b1 commit cc30b4a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions log/handlers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
});
Expand Down

0 comments on commit cc30b4a

Please sign in to comment.