Skip to content

Commit

Permalink
Tests: Capture stream errors [fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 30, 2023
1 parent d7eefda commit 9b49b4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,12 @@ function runMainTests(methodName, method, getYauzl, Promise) {
promise = zipFile.openReadStream(entry);
return promise.then((thisStream) => {
stream = thisStream;
stream.on('error', () => {});
});
});

afterEach(() => {
stream.on('error', () => {}).destroy();
stream.destroy();
});

it('returns a Promise', () => {
Expand All @@ -362,11 +363,12 @@ function runMainTests(methodName, method, getYauzl, Promise) {
promise = entry.openReadStream();
return promise.then((thisStream) => {
stream = thisStream;
stream.on('error', () => {});
});
});

afterEach(() => {
stream.on('error', () => {}).destroy();
stream.destroy();
});

it('returns a Promise', () => {
Expand Down

0 comments on commit 9b49b4b

Please sign in to comment.