test: fix intrinsics test · nodejs/node@31995e4 (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 31995e4
authored and
committed
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: #26660Reviewed-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
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,8 +3,7 @@ | ||
3 | 3 | require('../common'); |
4 | 4 | const assert = require('assert'); |
5 | 5 | |
6 | -try { | |
7 | -Object.defineProperty = 'asdf'; | |
8 | -assert(false); | |
9 | -} catch { | |
10 | -} | |
6 | +assert.throws( | |
7 | +() => Object.defineProperty = 'asdf', | |
8 | +TypeError | |
9 | +); |