node/test/parallel/test-repl-syntax-error-stack.js
Rich Trott c14726cefc test: remove unused vars from parallel tests
Remove all remaining unused variables from tests in test/parallel.

PR-URL: https://github.com/nodejs/node/pull/4511
Reviewed-By: James M Snell<jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2016-01-04 14:20:03 -08:00

27 lines
599 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
const repl = require('repl');
let found = false;
process.on('exit', () => {
assert.strictEqual(found, true);
});
common.ArrayStream.prototype.write = function(output) {
if (/var foo bar;/.test(output))
found = true;
};
const putIn = new common.ArrayStream();
repl.start('', putIn);
let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax');
if (common.isWindows)
file = file.replace(/\\/g, '\\\\');
putIn.run(['.clear']);
putIn.run([`require('${file}');`]);