Skip to content

Commit

Permalink
test: add DataView test entry for whatwg
Browse files Browse the repository at this point in the history
The WHATWG `ReadableStream` test needs a new test entry for reading a
`DataView`.

PR-URL: #40622
Fixes: #40612
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
VoltrexKeyva authored and danielleadams committed Mar 2, 2022
1 parent 16d8424 commit c492f12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-whatwg-readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -1602,3 +1602,18 @@ class Source {
isReadable(stream, false);
})().then(common.mustCall());
}

{
const stream = new ReadableStream({
type: 'bytes',
start(controller) {
controller.close();
}
});

const buffer = new ArrayBuffer(1024);
const reader = stream.getReader({ mode: 'byob' });

reader.read(new DataView(buffer))
.then(common.mustCall());
}

0 comments on commit c492f12

Please sign in to comment.