Skip to content

Commit f123c08

Browse files
author
Kelly Selden
committed
properly unregister listener
1 parent 8690819 commit f123c08

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test/tests.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@ describe('runs codemods', function() {
8686
}
8787
});
8888

89-
ps.stdout.on('data', data => {
89+
function stdoutData(data) {
9090
let str = data.toString();
9191
if (str.includes('These codemods apply to your project.')) {
9292
let down = '\u001b[B';
9393
let space = ' ';
9494
let enter = '\n';
9595
ps.stdin.write(`${down.repeat(i)}${space}${enter}`);
96+
97+
ps.stdout.removeListener('data', stdoutData);
9698
}
97-
});
99+
}
100+
101+
ps.stdout.on('data', stdoutData);
98102

99103
let {
100104
status

0 commit comments

Comments
 (0)