Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
local
/
lib
/
node_modules
/
npm
/
node_modules
/
tar
/
node_modules
/
minipass
/
test
/
File Content:
empty-end.js
const t = require('tap') const MP = require('../') t.test('emit end on resume', async t => { const list = [] const mp = new MP() mp.on('end', _ => list.push('end')) mp.end() t.notOk(mp.emittedEnd) list.push('called end') mp.resume() t.ok(mp.emittedEnd) list.push('called resume') t.same(list, ['called end', 'end', 'called resume']) }) t.test('emit end on read()', async t => { const list = [] const mp = new MP() mp.on('end', _ => list.push('end')) mp.end() list.push('called end') mp.read() list.push('called read()') t.same(list, ['called end', 'end', 'called read()']) }) t.test('emit end on data handler', async t => { const list = [] const mp = new MP() mp.on('end', _ => list.push('end')) mp.end() list.push('called end') mp.on('data', _=>_) list.push('added data handler') t.same(list, ['called end', 'end', 'added data handler']) })
Submit
FILE
FOLDER
Name
Size
Permission
Action
basic.js
11677 bytes
0644
empty-end.js
898 bytes
0644
N4ST4R_ID | Naxtarrr