node/test/parallel/test-vm-syntax-error-stderr.js
Santiago Gimeno eaab17c6a7 test: move some test from sequential to parallel
The only test with modifications is `test-stdin-child-proc` that was
passing when it should not because the exit code of the child process
was not being checked.

PR-URL: https://github.com/nodejs/node/pull/6087
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
2016-04-08 17:12:33 -07:00

30 lines
685 B
JavaScript

'use strict';
var common = require('../common');
var assert = require('assert');
var path = require('path');
var child_process = require('child_process');
var wrong_script = path.join(common.fixturesDir, 'cert.pem');
var p = child_process.spawn(process.execPath, [
'-e',
'require(process.argv[1]);',
wrong_script
]);
p.stdout.on('data', function(data) {
assert(false, 'Unexpected stdout data: ' + data);
});
var output = '';
p.stderr.on('data', function(data) {
output += data;
});
process.on('exit', function() {
assert(/BEGIN CERT/.test(output));
assert(/^\s+\^/m.test(output));
assert(/Invalid left-hand side expression in prefix operation/.test(output));
});