Skip to content

Commit b476793

Browse files
committed
Fix async throws
1 parent 76ccd9c commit b476793

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎test/assert.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ function deepStrictEqual(actual, expected, message) {
4949
}
5050
throw err;
5151
}
52-
async function throws(cb) {
52+
function throws(cb) {
5353
try {
5454
cb();
5555
}
5656
catch (e) {
5757
return;
5858
}
59-
throw new Error('Missing expected exception.');
59+
throw new Error('Missing expected exception');
6060
}
6161
async function rejects(cb) {
6262
try {
@@ -65,7 +65,7 @@ async function rejects(cb) {
6565
catch (e) {
6666
return;
6767
}
68-
throw new Error('Missing expected rejection.');
68+
throw new Error('Missing expected rejection');
6969
}
7070
// Run tests with node assert:
7171
// import { deepStrictEqual, throws } from "assert";

‎test/assert.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ function deepStrictEqual(actual: unknown, expected: unknown, message?: string) {
5454
throw err;
5555
}
5656

57-
async function throws(cb: () => any) {
57+
function throws(cb: () => any) {
5858
try {
5959
cb();
6060
} catch (e) {
6161
return;
6262
}
63-
throw new Error('Missing expected exception.');
63+
throw new Error('Missing expected exception');
6464
}
6565

6666
async function rejects(cb: () => Promise<any>): Promise<void> {
@@ -69,7 +69,7 @@ async function rejects(cb: () => Promise<any>): Promise<void> {
6969
} catch (e) {
7070
return;
7171
}
72-
throw new Error('Missing expected rejection.');
72+
throw new Error('Missing expected rejection');
7373
}
7474

7575
// Run tests with node assert:

0 commit comments

Comments
 (0)