mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05: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:
1 parent
0d3aa725cf
commit
377deded59
3 files changed
+33
No files matched your search
@@ -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',
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user