Skip to content

Commit f3812bc

Browse files
committed
#1 - WIP: Added more tests
Signed-off-by: Gregor Anders <[email protected]>
1 parent 97ba1bf commit f3812bc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/mainService.spec.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,24 @@ describe("MainService", (): void => {
99
it("MainService export exists", (): void => {
1010
expect(TestSubject.MainService).toBeDefined();
1111
});
12+
13+
it("register", (): void => {
14+
const ipc: any = {
15+
on: jest.fn(),
16+
};
17+
18+
const testSubject: TestSubject.MainService = new TestSubject.MainService(ipc, "main-channel");
19+
testSubject.register();
20+
expect(ipc.on).toHaveBeenCalledTimes(1);
21+
});
22+
23+
it("callback", (): void => {
24+
const ipc: any = {
25+
on: jest.fn(),
26+
};
27+
28+
const testSubject: TestSubject.MainService = new TestSubject.MainService(ipc, "main-channel");
29+
testSubject.register();
30+
expect(ipc.on).toHaveBeenCalledTimes(1);
31+
});
1232
});

0 commit comments

Comments
 (0)