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()`. PR-URL: https://github.com/nodejs/node/pull/22849 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
ff66132339
commit
d369ef05c8
@ -26,8 +26,8 @@ const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const vm = require('vm');
|
||||
|
||||
assert.strictEqual(typeof global.gc, 'function',
|
||||
'Run this test with --expose-gc');
|
||||
if (typeof global.gc !== 'function')
|
||||
assert.fail('Run this test with --expose-gc');
|
||||
|
||||
// Run a string
|
||||
const result = vm.runInNewContext('\'passed\';');
|
||||
|
Loading…
x
Reference in New Issue
Block a user