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 nodejs-github-bot committed Jan 20, 2022
1 parent c4a6f9a commit de9dc41
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-whatwg-readablestream.js
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 de9dc41

Please sign in to comment.