mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 21:54:48 +00:00
fix: wrong usage of assertThrowsAsync which without await keyword (denoland/deno_std#295)
Original: 59adafe867
This commit is contained in:
parent
4ac66ec640
commit
eaa795d477
5 changed files with 19 additions and 15 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue