Skip to content

Commit

Permalink
Add test for silent force kill (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulken authored Apr 13, 2020
1 parent e76a960 commit fd8c3b8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@ test('error when process is not found', async t => {
/Killing process notFoundProcess failed: Process doesn't exist/
);
});

test('force killing process at unused port throws error', async t => {
await t.throwsAsync(
execa('./cli.js', ['--force', ':1337']),
/Killing process :1337 failed: Process doesn't exist/
);
});

test('silently force killing process at unused port exits with code 0', async t => {
const {exitCode} = await execa('./cli.js', ['--force', '--silent', ':1337']);
t.is(exitCode, 0);
});

0 comments on commit fd8c3b8

Please sign in to comment.