Skip to content

Commit b6060db

Browse files
committed
test_runner: alias assert.throws to fix lint error
Bypass `no-restricted-syntax` ("Only use simple assertions") in failure validation logic by aliasing `assert.throws`.
1 parent 67a4a61 commit b6060db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/test_runner/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,8 @@ class Test extends AsyncResource {
959959
this.expectFailure.with !== undefined) {
960960
const { with: validation } = this.expectFailure;
961961
try {
962-
assert.throws(() => { throw err; }, validation);
962+
const { throws } = assert;
963+
throws(() => { throw err; }, validation);
963964
} catch (e) {
964965
this.passed = false;
965966
this.error = new ERR_TEST_FAILURE(

0 commit comments

Comments
 (0)