test: refactor test-vm-syntax-error-stderr.js

use common.fail instead of assert(false)
change var to let or const as appropriate

PR-URL: https://github.com/nodejs/node/pull/9900
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Jay Brownlee 2016-12-01 10:06:21 -06:00 committed by James M Snell
parent 5e5ec12c10
commit fa228547d3

View File

@ -1,22 +1,22 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var path = require('path'); const path = require('path');
var child_process = require('child_process'); const child_process = require('child_process');
var wrong_script = path.join(common.fixturesDir, 'cert.pem'); const wrong_script = path.join(common.fixturesDir, 'cert.pem');
var p = child_process.spawn(process.execPath, [ const p = child_process.spawn(process.execPath, [
'-e', '-e',
'require(process.argv[1]);', 'require(process.argv[1]);',
wrong_script wrong_script
]); ]);
p.stdout.on('data', function(data) { p.stdout.on('data', function(data) {
assert(false, 'Unexpected stdout data: ' + data); common.fail('Unexpected stdout data: ' + data);
}); });
var output = ''; let output = '';
p.stderr.on('data', function(data) { p.stderr.on('data', function(data) {
output += data; output += data;