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