GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: improve assert error messages · nodejs/node@4d782c4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-stream-pipe-await-drain.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipe-await-drain.js
+14-6Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ writer1._write = common.mustCall(function(chunk, encoding, cb) {
2323
}, 1);
2424

2525
writer1.once('chunk-received', function() {
26-
assert.strictEqual(reader._readableState.awaitDrain, 0,
27-
'initial value is not 0');
26+
assert.strictEqual(
27+
reader._readableState.awaitDrain,
28+
0,
29+
'awaitDrain initial value should be 0, actual is ' +
30+
reader._readableState.awaitDrain
31+
);
2832
setImmediate(function() {
2933
// This one should *not* get through to writer1 because writer2 is not
3034
// "done" processing.
@@ -35,8 +39,10 @@ writer1.once('chunk-received', function() {
3539
// A "slow" consumer:
3640
writer2._write = common.mustCall(function(chunk, encoding, cb) {
3741
assert.strictEqual(
38-
reader._readableState.awaitDrain, 1,
39-
'awaitDrain isn\'t 1 after first push'
42+
reader._readableState.awaitDrain,
43+
1,
44+
'awaitDrain should be 1 after first push, actual is ' +
45+
reader._readableState.awaitDrain
4046
);
4147
// Not calling cb here to "simulate" slow stream.
4248
// This should be called exactly once, since the first .write() call
@@ -45,8 +51,10 @@ writer2._write = common.mustCall(function(chunk, encoding, cb) {
4551

4652
writer3._write = common.mustCall(function(chunk, encoding, cb) {
4753
assert.strictEqual(
48-
reader._readableState.awaitDrain, 2,
49-
'awaitDrain isn\'t 2 after second push'
54+
reader._readableState.awaitDrain,
55+
2,
56+
'awaitDrain should be 2 after second push, actual is ' +
57+
reader._readableState.awaitDrain
5058
);
5159
// Not calling cb here to "simulate" slow stream.
5260
// This should be called exactly once, since the first .write() call

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.