Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0bc16cd

Browse filesBrowse files
katie-robertsMylesBorins
authored andcommitted
test: improve assert messages in stream test
In test-stream-pipe-await-train-manual-resume, include unexpected value in error messages. PR-URL: #16884 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 7c9aee3 commit 0bc16cd
Copy full SHA for 0bc16cd

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-stream-pipe-await-drain-manual-resume.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipe-await-drain-manual-resume.js
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ readable.once('pause', common.mustCall(() => {
3030
assert.strictEqual(
3131
readable._readableState.awaitDrain,
3232
1,
33-
'awaitDrain doesn\'t increase'
33+
'Expected awaitDrain to equal 1 but instead got ' +
34+
`${readable._readableState.awaitDrain}`
3435
);
3536
// First pause, resume manually. The next write() to writable will still
3637
// return false, because chunks are still being buffered, so it will increase
3738
// the awaitDrain counter again.
39+
3840
process.nextTick(common.mustCall(() => {
3941
readable.resume();
4042
}));
@@ -43,7 +45,8 @@ readable.once('pause', common.mustCall(() => {
4345
assert.strictEqual(
4446
readable._readableState.awaitDrain,
4547
1,
46-
'.resume() does not reset counter'
48+
'.resume() should not reset the counter but instead got ' +
49+
`${readable._readableState.awaitDrain}`
4750
);
4851
// Second pause, handle all chunks from now on. Once all callbacks that
4952
// are currently queued up are handled, the awaitDrain drain counter should
@@ -64,7 +67,8 @@ writable.on('finish', common.mustCall(() => {
6467
assert.strictEqual(
6568
readable._readableState.awaitDrain,
6669
0,
67-
'awaitDrain not 0 after all chunks are written'
70+
'awaitDrain should equal 0 after all chunks are written but instead got' +
71+
`${readable._readableState.awaitDrain}`
6872
);
6973
// Everything okay, all chunks were written.
7074
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.