node/test/parallel/test-regress-GH-1899.js
Sakthipriyan Vairamani 612307564b test: make import common as the first line
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>
2016-07-21 16:39:21 -07:00

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');
});