diff --git a/bin/concurrently.spec.ts b/bin/concurrently.spec.ts index c0b2e1bb..3cbb400f 100644 --- a/bin/concurrently.spec.ts +++ b/bin/concurrently.spec.ts @@ -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); }); });