Commit 45e7b10
test: fix 'checks' validation test for checkPrime
This test had two problems:
* The first argument was a number in both cases, which is what caused
the (expected) ERR_INVALID_ARG_TYPE error -- the validity of the
'checks' option was not actually verified at all. Thus, the first
argument should be valid for this particular test.
* The function returned by common.mustNotCall() was passed to
assert.throws() as a third argument instead of being passed to
checkPrime() as a third argument. (Isn't JavaScript great?) This again
led to the (expected) ERR_INVALID_ARG_TYPE error, but again, the
validity of the 'checks' option was not verified.
Fix both issues by ensuring that all arguments except the 'checks'
option are valid.
Refs: #36997
PR-URL: #47139
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent 5749dfa commit 45e7b10Copy full SHA for 45e7b10
File tree
Expand file treeCollapse file tree
1 file changed
+9
-7
lines changedOpen diff view settings
Filter options
- test/parallel
Expand file treeCollapse file tree
1 file changed
+9
-7
lines changedOpen diff view settings
Collapse file
test/parallel/test-crypto-prime.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-prime.js+9-7Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
229 | 229 | |
230 | 230 | |
231 | 231 | |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | | - |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
238 | 236 | |
239 | | - |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
240 | 242 | |
241 | 243 | |
242 | 244 | |
|
0 commit comments