Skip to content

Commit 3a0348b

Browse files
committed
Added a test for --completion cli option
1 parent 5f71449 commit 3a0348b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/cases.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import {MockWriteStreams} from "../src/mock-write-streams";
22
import * as chalk from "chalk";
33
import {handler} from "../src/handler";
44

5+
test("--completion", async () => {
6+
const spy = jest.spyOn(console, "log").mockImplementation();
7+
const writeStreams = new MockWriteStreams();
8+
await handler({
9+
completion: true,
10+
}, writeStreams);
11+
expect(console.log).toHaveBeenCalledTimes(1);
12+
spy.mockRestore();
13+
});
14+
515
test("something/unknown-directory (non-existing dir)", async () => {
616
try {
717
const writeStreams = new MockWriteStreams();

0 commit comments

Comments
 (0)