Skip to content

Commit a5f7f1d

Browse files
Trotttargos
authored andcommitted
test: refactor flag check
Refactor test-vm-run-in-new-context so that check for `--expose-gc` flag will not run afoul of an upcoming lint rule that checks that string literals are not used for the `message` argument of `assert.strictEqual()`. Backport-PR-URL: #22912 PR-URL: #22849 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e5de225 commit a5f7f1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-vm-run-in-new-context.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const common = require('../common');
2626
const assert = require('assert');
2727
const vm = require('vm');
2828

29-
assert.strictEqual(typeof global.gc, 'function',
30-
'Run this test with --expose-gc');
29+
if (typeof global.gc !== 'function')
30+
assert.fail('Run this test with --expose-gc');
3131

3232
// Run a string
3333
const result = vm.runInNewContext('\'passed\';');

0 commit comments

Comments
 (0)