test: improve assert error messages · nodejs/node@4d782c4
@@ -23,8 +23,12 @@ writer1._write = common.mustCall(function(chunk, encoding, cb) {
2323}, 1);
24242525writer1.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+);
2832setImmediate(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:
3640writer2._write = common.mustCall(function(chunk, encoding, cb) {
3741assert.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) {
45514652writer3._write = common.mustCall(function(chunk, encoding, cb) {
4753assert.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