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 BethGriggs committed Jan 24, 2022
1 parent 5027e94 commit 6de8e51
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 6de8e51

Please sign in to comment.