mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 13:01:31 +00:00

The `test/common` module has the capability to identify if any variable is leaked to the global scope and fail the test. So that has to be imported at the beginning. PR-URL: https://github.com/nodejs/node/pull/7786 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
21 lines
447 B
JavaScript
21 lines
447 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
var path = require('path');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
var child = spawn(process.argv[0], [
|
|
path.join(common.fixturesDir, 'GH-1899-output.js')
|
|
]);
|
|
var output = '';
|
|
|
|
child.stdout.on('data', function(data) {
|
|
output += data;
|
|
});
|
|
|
|
child.on('exit', function(code, signal) {
|
|
assert.equal(code, 0);
|
|
assert.equal(output, 'hello, world!\n');
|
|
});
|
|
|