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 --- testing/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'testing') diff --git a/testing/README.md b/testing/README.md index 3d49c5a76..684d5d4bc 100644 --- a/testing/README.md +++ b/testing/README.md @@ -113,27 +113,27 @@ Using `assertThrowsAsync()`: ```ts test(async function doesThrow() { - assertThrowsAsync(async () => { + await assertThrowsAsync(async () => { throw new TypeError("hello world!"); }); - assertThrowsAsync(async () => { + await assertThrowsAsync(async () => { throw new TypeError("hello world!"); }, TypeError); - assertThrowsAsync( + await assertThrowsAsync( async () => { throw new TypeError("hello world!"); }, TypeError, "hello" ); - assertThrowsAsync(async () => { + await assertThrowsAsync(async () => { return Promise.reject(new Error()); }); }); // This test will not pass test(async function fails() { - assertThrowsAsync(async () => { + await assertThrowsAsync(async () => { console.log("Hello world"); }); }); -- cgit v1.2.3