aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-run-in-new-context.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-09-12 20:16:23 -0700
committerRich Trott <rtrott@gmail.com>2018-09-16 20:37:31 -0700
commitd369ef05c85e7629775fce35e63d32cbdd527e5c (patch)
treeedf3f2108eecbd7aff29c80bf1aa651e1122ab25 /test/parallel/test-vm-run-in-new-context.js
parentff661323399c94fb7aee9b0b1e16a2853d42b343 (diff)
downloadandroid-node-v8-d369ef05c85e7629775fce35e63d32cbdd527e5c.tar.gz
android-node-v8-d369ef05c85e7629775fce35e63d32cbdd527e5c.tar.bz2
android-node-v8-d369ef05c85e7629775fce35e63d32cbdd527e5c.zip
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>
Diffstat (limited to 'test/parallel/test-vm-run-in-new-context.js')
-rw-r--r--test/parallel/test-vm-run-in-new-context.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js
index e844cd6816..51577668cf 100644
--- a/test/parallel/test-vm-run-in-new-context.js
+++ b/test/parallel/test-vm-run-in-new-context.js
@@ -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\';');