Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix emptydir on windows #531

Merged
merged 1 commit into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fs/empty_dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function emptyDir(dir: string): Promise<void> {
const item = items.shift();
if (item && item.name) {
const fn = dir + "/" + item.name;
Deno.remove(fn, { recursive: true });
await Deno.remove(fn, { recursive: true });
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions fs/empty_dir_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
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 * as path from "./path/mod.ts";

Expand Down Expand Up @@ -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> {
const testDir = path.join(testdataDir, "empty_dir_test_3");
const testNestDir = path.join(testDir, "nest");
Expand Down Expand Up @@ -81,7 +84,6 @@ test(async function emptyDirIfItExist(): Promise<void> {
await Deno.remove(testDir, { recursive: true });
}
});
*/

test(function emptyDirSyncIfItExist(): void {
const testDir = path.join(testdataDir, "empty_dir_test_4");
Expand Down