Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/sites/node_modules/stream-browserify/test/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var test = require('tape');
var pipeline = require('..').pipeline;
var stream = require('..');
var Buffer = require('safe-buffer').Buffer;
test('supports pipeline', function(t) {
t.plan(4);
var readable = new stream.Readable({
read: function () {
this.push(Buffer.from('chunk', 'ascii'));
}
});
var transform1 = new stream.Transform({
transform: function (chunk, enc, cb) {
cb(new Error('fail'));
}
});
var transform2 = new stream.PassThrough();
transform2.on('close', function () {
t.pass('transform2.close called');
});
var writable = new stream.Writable({
write: function (chunk, enc, cb) { cb(); }
});
writable.on('close', function () {
t.pass('writable.close called');
});
pipeline(
readable,
transform1,
transform2,
writable,
function(err) {
t.ok(err);
t.equal(err.message, 'fail');
});
});
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0473 ]-- |