Skip to content

Commit

Permalink
chore: try again
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonoh committed Nov 8, 2020
1 parent 6530b6f commit 2232012
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,17 @@ describe('cli', () => {

await new Promise(res => {
const s = spawn('node', [cliJsPath, '--help']);
s.stdout.on('data', (data: Buffer) => output.push(data.toString()));
s.on('exit', res);
s.stdout.on('data', (data: Buffer) => {
output.push(data.toString());
console.log('>>> data', data.toString());
});
s.on('close', () => {
console.log('>>> close', output);
res();
});
});

console.log(output);
console.log(output.join(''));

expect(output.join('')).toMatchSnapshot();
});
Expand Down
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,10 @@ export const main = (argvInput?: string[]): Promise<void> =>
/* istanbul ignore next */
const cleanExit = (): void => {
process.stdout.write('\n');
process.exit(255);
process.exit();
};
process.on('SIGINT', cleanExit); // catch ctrl-c
process.on('SIGTERM', cleanExit); // catch kill
process.on('exit', cleanExit); // catch exit

/* istanbul ignore if */
if (
Expand Down

0 comments on commit 2232012

Please sign in to comment.