Skip to content

Commit

Permalink
test: remove event listeners before abort
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarchini committed Oct 3, 2024
1 parent e0b7a48 commit a162f2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-runner-run-watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ describe('test runner watch mode', () => {
signal: controller.signal,
}).on('data', function({ type }) {
if (type === 'test:watch:drained') {
stream.removeAllListeners('test:fail');
stream.removeAllListeners('test:pass');
controller.abort();
}
});
Expand All @@ -298,6 +300,8 @@ describe('test runner watch mode', () => {
isolation: 'none',
}).on('data', function({ type }) {
if (type === 'test:watch:drained') {
stream.removeAllListeners('test:fail');
stream.removeAllListeners('test:pass');
controller.abort();
}
});
Expand All @@ -317,6 +321,8 @@ describe('test runner watch mode', () => {
isolation: 'process',
}).on('data', function({ type }) {
if (type === 'test:watch:drained') {
stream.removeAllListeners('test:fail');
stream.removeAllListeners('test:pass');
controller.abort();
}
});
Expand Down

0 comments on commit a162f2d

Please sign in to comment.