Skip to content

Commit

Permalink
[Fix] use readable-stream to fix tests in node < 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 23, 2022
1 parent 835cf99 commit 358d919
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"duplexer": "^0.1.2",
"minimist": "^1.2.6",
"npm-which": "^1.0.2",
"readable-stream": "^2.3.7",
"safe-regex-test": "^1.0.0",
"sprintf-js": "^1.1.2",
"string.prototype.split": "^1.0.6",
Expand Down
15 changes: 9 additions & 6 deletions test/long-message/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var test = require('tape');
var stream = require('stream');
var Readable = require('readable-stream');
var path = require('path');
var fs = require('fs');
var faucet = require('../..');
Expand All @@ -11,11 +11,14 @@ function createFormatter() {
}

function streamifyString(string) {
return new stream.Readable({
read: function () {
this.push(string);
this.push(null);
}
function read() {
/* eslint no-invalid-this: 0 */
this.push(string);
this.push(null);
}
return new Readable({
_read: read,
read: read
});
}

Expand Down

0 comments on commit 358d919

Please sign in to comment.