mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
parent
c08a27de9a
commit
1a42695beb
2 changed files with 6 additions and 4 deletions
|
@ -18,7 +18,7 @@ export async function emptyDir(dir: string): Promise<void> {
|
||||||
const item = items.shift();
|
const item = items.shift();
|
||||||
if (item && item.name) {
|
if (item && item.name) {
|
||||||
const fn = dir + "/" + item.name;
|
const fn = dir + "/" + item.name;
|
||||||
Deno.remove(fn, { recursive: true });
|
await Deno.remove(fn, { recursive: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||||
import { test } from "../testing/mod.ts";
|
import { test } from "../testing/mod.ts";
|
||||||
import { assertEquals, assertThrows } from "../testing/asserts.ts";
|
import {
|
||||||
|
assertEquals,
|
||||||
|
assertThrows,
|
||||||
|
assertThrowsAsync
|
||||||
|
} from "../testing/asserts.ts";
|
||||||
import { emptyDir, emptyDirSync } from "./empty_dir.ts";
|
import { emptyDir, emptyDirSync } from "./empty_dir.ts";
|
||||||
import * as path from "./path/mod.ts";
|
import * as path from "./path/mod.ts";
|
||||||
|
|
||||||
|
@ -38,7 +42,6 @@ test(function emptyDirSyncIfItNotExist(): void {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* TODO(ry) Re-enable this test. It's broken on windows.
|
|
||||||
test(async function emptyDirIfItExist(): Promise<void> {
|
test(async function emptyDirIfItExist(): Promise<void> {
|
||||||
const testDir = path.join(testdataDir, "empty_dir_test_3");
|
const testDir = path.join(testdataDir, "empty_dir_test_3");
|
||||||
const testNestDir = path.join(testDir, "nest");
|
const testNestDir = path.join(testDir, "nest");
|
||||||
|
@ -81,7 +84,6 @@ test(async function emptyDirIfItExist(): Promise<void> {
|
||||||
await Deno.remove(testDir, { recursive: true });
|
await Deno.remove(testDir, { recursive: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
test(function emptyDirSyncIfItExist(): void {
|
test(function emptyDirSyncIfItExist(): void {
|
||||||
const testDir = path.join(testdataDir, "empty_dir_test_4");
|
const testDir = path.join(testdataDir, "empty_dir_test_4");
|
||||||
|
|
Loading…
Reference in a new issue