mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

A number of tests in `test/parallel` were importing the `util` module via `require()` but not using `util` for anything. This removes those `require()` statements. PR-URL: https://github.com/nodejs/node/pull/4397 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
27 lines
614 B
JavaScript
27 lines
614 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();
|
|
const testMe = 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}');`]);
|