mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
778 B
18 lines
778 B
'use strict';
|
|
|
|
if (process.argv[2] === 'child') {
|
|
const common = require('../../common');
|
|
console.log(require(`./build/${common.buildType}/test_warning`));
|
|
console.log(require(`./build/${common.buildType}/test_warning2`));
|
|
} else {
|
|
const run = require('child_process').spawnSync;
|
|
const assert = require('assert');
|
|
const warning = 'Warning: N-API is an experimental feature and could ' +
|
|
'change at any time.';
|
|
|
|
const result = run(process.execPath, [__filename, 'child']);
|
|
assert.deepStrictEqual(result.stdout.toString().match(/\S+/g), ['42', '1337'],
|
|
'Modules loaded correctly');
|
|
assert.deepStrictEqual(result.stderr.toString().split(warning).length, 2,
|
|
'Warning was displayed only once');
|
|
}
|
|
|