Skip to content

Commit 664be90

Browse files
BridgeARtargos
authored andcommitted
test: fix intrinsics test
So far this test did not verify that the call did indeed fail since the error case was not checked. This makes sure the error is indeed thrown as expected. PR-URL: nodejs#26660 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 45fc920 commit 664be90

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

test/parallel/test-freeze-intrinsics.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
require('../common');
44
const assert = require('assert');
55

6-
try {
7-
Object.defineProperty = 'asdf';
8-
assert(false);
9-
} catch {
10-
}
6+
assert.throws(
7+
() => Object.defineProperty = 'asdf',
8+
TypeError
9+
);

0 commit comments

Comments
 (0)