From eaa795d477948c11a99d0c1cf42f25ba668d892f Mon Sep 17 00:00:00 2001 From: Axetroy Date: Wed, 20 Mar 2019 01:22:33 +0800 Subject: fix: wrong usage of assertThrowsAsync which without await keyword (denoland/deno_std#295) Original: https://github.com/denoland/deno_std/commit/59adafe86710038c6864fc0686f0292bf7fd9b1d --- fs/empty_dir_test.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fs/empty_dir_test.ts') diff --git a/fs/empty_dir_test.ts b/fs/empty_dir_test.ts index d4a0de77a..d91c497a7 100644 --- a/fs/empty_dir_test.ts +++ b/fs/empty_dir_test.ts @@ -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 { -- cgit v1.2.3