Skip to content

Commit 079b59d

Browse files
committed
test: improve test coverage for index
1 parent ede5eca commit 079b59d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎test/unit/index.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
describe('index', () => {
2+
beforeEach(() => {
3+
jest.resetModules();
4+
});
5+
6+
it('instantiates CLI and runs it', async () => {
7+
const run = jest.fn();
8+
const CLI = jest.fn(() => ({ run }));
9+
10+
jest.doMock('../../src/cli', () => ({ CLI }));
11+
12+
await import('../../src/index');
13+
14+
expect(CLI).toHaveBeenCalledTimes(1);
15+
expect(run).toHaveBeenCalledTimes(1);
16+
});
17+
});

0 commit comments

Comments
 (0)