Skip to content

Commit

Permalink
bin: improve tests for version flag
Browse files Browse the repository at this point in the history
In preparation for #418
  • Loading branch information
gustavohenke committed Apr 2, 2024
1 parent ffdcb12 commit 61e8b0f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/concurrently.spec.ts
Expand Up @@ -117,10 +117,16 @@ it('has help command', async () => {
});

describe('has version command', () => {
const pkg = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8');
const { version } = JSON.parse(pkg);

it.each(['--version', '-V', '-v'])('%s', async (arg) => {
const exit = await run(arg).exit;
const child = run(arg);
const log = await child.getLogLines();
expect(log).toContain(version);

expect(exit.code).toBe(0);
const { code } = await child.exit;
expect(code).toBe(0);
});
});

Expand Down

0 comments on commit 61e8b0f

Please sign in to comment.