mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
test: move common.ArrayStream to separate module
In a continuing effort to de-monolithize `require('../common')`, move `common.ArrayStream` out to a separate module that is imported only when it is needed. PR-URL: https://github.com/nodejs/node/pull/22447 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
2d64a51270
commit
fa543c00cd
24 changed files with 103 additions and 66 deletions
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
const ArrayStream = require('../common/arraystream');
|
||||
const fixtures = require('../common/fixtures');
|
||||
const assert = require('assert');
|
||||
const repl = require('repl');
|
||||
|
@ -10,7 +11,7 @@ process.on('exit', () => {
|
|||
assert.strictEqual(found, true);
|
||||
});
|
||||
|
||||
common.ArrayStream.prototype.write = function(output) {
|
||||
ArrayStream.prototype.write = function(output) {
|
||||
// Matching only on a minimal piece of the stack because the string will vary
|
||||
// greatly depending on the JavaScript engine. V8 includes `;` because it
|
||||
// displays the line of code (`var foo bar;`) that is causing a problem.
|
||||
|
@ -20,7 +21,7 @@ common.ArrayStream.prototype.write = function(output) {
|
|||
found = true;
|
||||
};
|
||||
|
||||
const putIn = new common.ArrayStream();
|
||||
const putIn = new ArrayStream();
|
||||
repl.start('', putIn);
|
||||
let file = fixtures.path('syntax', 'bad_syntax');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue