Skip to content

Commit

Permalink
add cli test coverage (#648)
Browse files Browse the repository at this point in the history
Co-authored-by: Misha Kaletsky <mmkal@users.noreply.github.com>
  • Loading branch information
mmkal and mmkal committed Jan 31, 2024
1 parent ba456a8 commit 6980ff5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ describe('cli from instance', () => {
/Can't specify 'step' and 'name' together/
);

await expect(runCli(['down', '--name', 'm1.js', '--to', '0'])).rejects.toThrow(
/Can't specify 'to' and 'name' together/
);

await expect(runCli(['down', '--to', 'm1.js', '--step', '2'])).rejects.toThrow(
/Can't specify 'to' and 'step' together/
);

await expect(runCli(['down', '--step', '2', '--name', 'm2.js'])).rejects.toThrow(
/Can't specify 'step' and 'name' together/
);

await expect(runCli(['down', '--rerun', 'ALLOW'])).rejects.toThrow(
/Can't specify 'rerun' without 'name'/ // prettier-break
);

await expect(runCli(['up', '--name', 'm1.js', '--name', 'm3.js'])).resolves.toEqual(['m1.js', 'm3.js']);

await expect(runCli(['down', '--name', 'm1.js'])).resolves.toEqual(['m3.js']);
Expand Down

0 comments on commit 6980ff5

Please sign in to comment.