Skip to content

Commit 61e8b0f

Browse files
committed
bin: improve tests for version flag
In preparation for #418
1 parent ffdcb12 commit 61e8b0f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bin/concurrently.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,16 @@ it('has help command', async () => {
117117
});
118118

119119
describe('has version command', () => {
120+
const pkg = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8');
121+
const { version } = JSON.parse(pkg);
122+
120123
it.each(['--version', '-V', '-v'])('%s', async (arg) => {
121-
const exit = await run(arg).exit;
124+
const child = run(arg);
125+
const log = await child.getLogLines();
126+
expect(log).toContain(version);
122127

123-
expect(exit.code).toBe(0);
128+
const { code } = await child.exit;
129+
expect(code).toBe(0);
124130
});
125131
});
126132

0 commit comments

Comments
 (0)