Skip to content

Commit 7a5248d

Browse files
TrottMylesBorins
authored andcommitted
test: simplify assert usage in test-stream2-basic
PR-URL: #13146 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e15e2e7 commit 7a5248d

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

test/pummel/test-stream2-basic.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ function run() {
8585
const fn = next[1];
8686
console.log('# %s', name);
8787
fn({
88-
same: assert.deepStrictEqual,
89-
ok: assert,
90-
equal: assert.strictEqual,
9188
end: function() {
9289
count--;
9390
run();
@@ -189,10 +186,10 @@ test('pipe', function(t) {
189186
w[0].on('write', function() {
190187
if (--writes === 0) {
191188
r.unpipe();
192-
t.equal(r._readableState.pipes, null);
189+
assert.strictEqual(r._readableState.pipes, null);
193190
w[0].end();
194191
r.pipe(w[1]);
195-
t.equal(r._readableState.pipes, w[1]);
192+
assert.strictEqual(r._readableState.pipes, w[1]);
196193
}
197194
});
198195

@@ -201,17 +198,17 @@ test('pipe', function(t) {
201198
let ended0 = false;
202199
let ended1 = false;
203200
w[0].on('end', function(results) {
204-
t.equal(ended0, false);
201+
assert.strictEqual(ended0, false);
205202
ended0 = true;
206203
ended++;
207204
assert.deepStrictEqual(results, expect[0]);
208205
});
209206

210207
w[1].on('end', function(results) {
211-
t.equal(ended1, false);
208+
assert.strictEqual(ended1, false);
212209
ended1 = true;
213210
ended++;
214-
t.equal(ended, 2);
211+
assert.strictEqual(ended, 2);
215212
assert.deepStrictEqual(results, expect[1]);
216213
t.end();
217214
});
@@ -289,7 +286,7 @@ test('multipipe', function(t) {
289286

290287
w[1].on('end', function(results) {
291288
ended++;
292-
t.equal(ended, 2);
289+
assert.strictEqual(ended, 2);
293290
assert.deepStrictEqual(results, expect[1]);
294291
t.end();
295292
});
@@ -441,8 +438,8 @@ test('adding readable triggers data flow', function(t) {
441438
});
442439

443440
r.on('end', function() {
444-
t.equal(readCalled, 3);
445-
t.ok(onReadable);
441+
assert.strictEqual(readCalled, 3);
442+
assert.ok(onReadable);
446443
t.end();
447444
});
448445
});
@@ -451,6 +448,6 @@ test('chainable', function(t) {
451448
const r = new R();
452449
r._read = common.mustCall();
453450
const r2 = r.setEncoding('utf8').pause().resume().pause();
454-
t.equal(r, r2);
451+
assert.strictEqual(r, r2);
455452
t.end();
456453
});

0 commit comments

Comments
 (0)