fix: wrong usage of assertThrowsAsync which without await keyword (denoland/deno_std#295)

Original: 59adafe867
This commit is contained in:
Axetroy 2019-03-20 01:22:33 +08:00 committed by Ryan Dahl
parent 4ac66ec640
commit eaa795d477
5 changed files with 19 additions and 15 deletions

View file

@ -1,6 +1,10 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../testing/mod.ts";
import { assertEquals, assertThrowsAsync } 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";
@ -63,12 +67,12 @@ test(async function emptyDirIfItExist() {
assertEquals(stat.isDirectory(), true);
// nest directory have been remove
assertThrowsAsync(async () => {
await assertThrowsAsync(async () => {
await Deno.stat(testNestDir);
});
// test file have been remove
assertThrowsAsync(async () => {
await assertThrowsAsync(async () => {
await Deno.stat(testDirFile);
});
} finally {
@ -102,12 +106,12 @@ test(function emptyDirSyncIfItExist() {
assertEquals(stat.isDirectory(), true);
// nest directory have been remove
assertThrowsAsync(async () => {
assertThrows(() => {
Deno.statSync(testNestDir);
});
// test file have been remove
assertThrowsAsync(async () => {
assertThrows(() => {
Deno.statSync(testDirFile);
});
} finally {