1
1
'use strict'
2
2
3
- const tap = require ( 'tap ' )
3
+ const test = require ( 'node:test ' )
4
4
const { Readable } = require ( 'node:stream' )
5
5
const streamToNull = require ( '../lib/stream-consumer' )
6
6
7
- tap . test ( 'does what it should' , async t => {
7
+ test ( 'does what it should' , async t => {
8
+ t . plan ( 1 )
8
9
let count = 1_000_000
9
10
const stream = new Readable ( {
10
11
read ( ) {
@@ -18,10 +19,11 @@ tap.test('does what it should', async t => {
18
19
} )
19
20
20
21
await streamToNull ( stream )
21
- t . pass ( )
22
+ t . assert . ok ( true )
22
23
} )
23
24
24
- tap . test ( 'handles close event' , async t => {
25
+ test ( 'handles close event' , async t => {
26
+ t . plan ( 1 )
25
27
let count = 1_000_000
26
28
const stream = new Readable ( {
27
29
read ( ) {
@@ -35,10 +37,11 @@ tap.test('handles close event', async t => {
35
37
} )
36
38
37
39
await streamToNull ( stream )
38
- t . pass ( )
40
+ t . assert . ok ( true )
39
41
} )
40
42
41
- tap . test ( 'handles error event' , async t => {
43
+ test ( 'handles error event' , async t => {
44
+ t . plan ( 1 )
42
45
let count = 1_000_000
43
46
const stream = new Readable ( {
44
47
read ( ) {
@@ -54,6 +57,6 @@ tap.test('handles error event', async t => {
54
57
try {
55
58
await streamToNull ( stream )
56
59
} catch ( error ) {
57
- t . match ( error , / b o o m / )
60
+ t . assert . match ( error . toString ( ) , / b o o m / )
58
61
}
59
62
} )
0 commit comments