test that streams emit end

This commit is contained in:
Mathias Buus 2023-06-17 19:15:07 +02:00
parent 2a1b1e9d99
commit 2fee69b72e

View file

@ -251,7 +251,7 @@ test('pax', function (t) {
}) })
test('types', function (t) { test('types', function (t) {
t.plan(3) t.plan(5)
const extract = tar.extract() const extract = tar.extract()
let noEntries = false let noEntries = false
@ -283,6 +283,9 @@ test('types', function (t) {
stream.on('data', function () { stream.on('data', function () {
t.ok(false) t.ok(false)
}) })
stream.on('end', function () {
t.pass('ended')
})
extract.once('entry', onlink) extract.once('entry', onlink)
cb() cb()
} }
@ -306,6 +309,9 @@ test('types', function (t) {
stream.on('data', function () { stream.on('data', function () {
t.ok(false) t.ok(false)
}) })
stream.on('end', function () {
t.pass('ended')
})
noEntries = true noEntries = true
cb() cb()
} }