From aa81bc73d96729f6593d55d2c1e66000e115dfe4 Mon Sep 17 00:00:00 2001 From: Sidd Sridharan Date: Wed, 16 Sep 2020 03:31:12 -0700 Subject: docs: fix typo assertAsyncThrows -> assertThrowsAsync (#7506) --- docs/testing/assertions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/testing/assertions.md') diff --git a/docs/testing/assertions.md b/docs/testing/assertions.md index 4513d5a8d..fe37eedd6 100644 --- a/docs/testing/assertions.md +++ b/docs/testing/assertions.md @@ -139,13 +139,13 @@ Deno.test("Test Assert Not Match", () => { ### Throws There are two ways to assert whether something throws an error in Deno, -`assertThrows()` and `assertAsyncThrows()`. Both assertions allow you to check +`assertThrows()` and `assertThrowsAsync()`. Both assertions allow you to check an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) has been thrown, the type of error thrown and what the message was. The difference between the two assertions is `assertThrows()` accepts a standard -function and `assertAsyncThrows()` accepts a function which returns a +function and `assertThrowsAsync()` accepts a function which returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). The `assertThrows()` assertion will check an error has been thrown, and @@ -164,7 +164,7 @@ Deno.test("Test Assert Throws", () => { }); ``` -The `assertAsyncThrows()` assertion is a little more complicated, mainly because +The `assertThrowsAsync()` assertion is a little more complicated, mainly because it deals with Promises. But basically it will catch thrown errors or rejections in Promises. You can also optionally check for the error type and error message. -- cgit v1.2.3