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:
parent
8f08b3f73d
commit
c9f7558cd1
1 changed files with 8 additions and 12 deletions
|
@ -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);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue