mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: test streambase has already has a consumer
test: test streambase has already has a consumer PR-URL: https://github.com/nodejs/node/pull/48059 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
996d198101
commit
eb46e09570
@ -65,3 +65,12 @@ const {
|
||||
const readable = newReadableStreamFromStreamBase(stream);
|
||||
readable.cancel().then(common.mustCall());
|
||||
}
|
||||
|
||||
{
|
||||
const stream = new JSStream();
|
||||
stream.onread = common.mustCall();
|
||||
assert.throws(() => newReadableStreamFromStreamBase(stream), {
|
||||
code: 'ERR_INVALID_STATE'
|
||||
});
|
||||
stream.emitEOF();
|
||||
}
|
||||
|
@ -248,3 +248,9 @@ const {
|
||||
reader.closed.then(common.mustCall());
|
||||
writer.close().then(common.mustCall());
|
||||
}
|
||||
|
||||
{
|
||||
assert.throws(() => newReadableWritablePairFromDuplex(null), {
|
||||
code: 'ERR_INVALID_ARG_TYPE'
|
||||
});
|
||||
}
|
||||
|
@ -164,3 +164,21 @@ const {
|
||||
|
||||
duplex.end();
|
||||
}
|
||||
|
||||
{
|
||||
const transform = { readable: {}, writable: {} };
|
||||
assert.throws(() => newStreamDuplexFromReadableWritablePair(transform), {
|
||||
code: 'ERR_INVALID_ARG_TYPE'
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const transform = {
|
||||
readable: new ReadableStream(),
|
||||
writable: null
|
||||
};
|
||||
|
||||
assert.throws(() => newStreamDuplexFromReadableWritablePair(transform), {
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user