We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc44d2c commit 7b76f82Copy full SHA for 7b76f82
test/parallel/test-common.js
@@ -2,14 +2,25 @@
2
const common = require('../common');
3
const assert = require('assert');
4
5
-common.globalCheck = false;
+
6
+// test for leaked global detection
7
global.gc = 42; // Not a valid global unless --expose_gc is set.
8
assert.deepStrictEqual(common.leakedGlobals(), ['gc']);
9
+delete global.gc;
10
11
12
+// common.mustCall() tests
13
assert.throws(function() {
14
common.mustCall(function() {}, 'foo');
15
}, /^TypeError: Invalid expected value: foo$/);
16
17
18
common.mustCall(function() {}, /foo/);
19
}, /^TypeError: Invalid expected value: \/foo\/$/);
20
21
22
+// common.fail() tests
23
+assert.throws(
24
+ () => { common.fail('fhqwhgads'); },
25
+ /^AssertionError: fhqwhgads$/
26
+);
0 commit comments