Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,15 @@
var test = require('tape');
var readonly = require('../');
var through = require('through2');
test('error', function (t) {
t.plan(1);
var stream = through();
var ro = readonly(stream);
ro.on('error', function (err) {
t.ok(err);
});
stream.emit('error', new Error);
});

View File

@ -0,0 +1,22 @@
var test = require('tape');
var readonly = require('../');
var through = require('through2');
var concat = require('concat-stream');
test('readonly', function (t) {
t.plan(2);
var stream = through();
stream.write('woo');
var ro = readonly(stream);
ro.pipe(concat(function (body) {
t.equal(body.toString('utf8'), 'woo');
}));
t.throws(function () {
ro.write('beep');
});
stream.end();
});

View File

@ -0,0 +1,21 @@
var test = require('tape');
var readonly = require('../');
var through = require('through');
var concat = require('concat-stream');
test('streams1', function (t) {
t.plan(2);
var stream = through();
var ro = readonly(stream);
ro.pipe(concat(function (body) {
t.equal(body.toString('utf8'), 'woo');
}));
t.throws(function () {
ro.write('beep');
});
stream.end('woo');
});