Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: link to assertThrows() and assertRejects() #4395

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assert/assert_rejects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { assertIsError } from "./assert_is_error.ts";
/**
* Executes a function which returns a promise, expecting it to reject.
*
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
*
* @example
* ```ts
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/assert/assert_rejects.ts";
Expand All @@ -22,6 +24,8 @@ export function assertRejects(
* If it does not, then it throws. An error class and a string that should be
* included in the error message can also be asserted.
*
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
*
* @example
* ```ts
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/assert/assert_rejects.ts";
Expand Down
6 changes: 6 additions & 0 deletions assert/assert_throws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { AssertionError } from "./assertion_error.ts";
* Executes a function, expecting it to throw. If it does not, then it
* throws.
*
* To assert that an asynchronous function rejects, use
* {@linkcode assertRejects}.
*
* @example
* ```ts
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/assert/assert_throws.ts";
Expand All @@ -23,6 +26,9 @@ export function assertThrows(
* throws. An error class and a string that should be included in the
* error message can also be asserted.
*
* To assert that an asynchronous function rejects, use
* {@linkcode assertRejects}.
*
* @example
* ```ts
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/assert/assert_throws.ts";
Expand Down
Loading