test: simplify force-context-aware test
PR-URL: https://github.com/nodejs/node/pull/29705 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
82f89ec8c1
commit
663ef98e9a
@ -1,4 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
const common = require('../../common');
|
|
||||||
|
|
||||||
require(`./build/${common.buildType}/binding`);
|
|
@ -1,13 +1,8 @@
|
|||||||
|
// Flags: --force-context-aware
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const childProcess = require('child_process');
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const mod = path.join('test', 'addons', 'force-context-aware', 'index.js');
|
assert.throws(() => {
|
||||||
|
require(`./build/${common.buildType}/binding`);
|
||||||
const execString = `"${process.execPath}" --force-context-aware ./${mod}`;
|
}, /^Error: Loading non context-aware native modules has been disabled$/);
|
||||||
childProcess.exec(execString, common.mustCall((err) => {
|
|
||||||
const errMsg = 'Loading non context-aware native modules has been disabled';
|
|
||||||
assert.strictEqual(err.message.includes(errMsg), true);
|
|
||||||
}));
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user