Skip to content

Commit 283af66

Browse files
committed
fix: tests covered more
1 parent cb0617f commit 283af66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ describe('Dev Tools Extension (Without Extension)', () => {
5757
beforeAll(() => {
5858
const useContextDevTools = require('./index').default;
5959
dispatchFn = jest.fn();
60-
dispatchContext = useContextDevTools(dispatchFn);
60+
dispatchContext = useContextDevTools();
6161
});
6262

6363
test('Should initialize devTools', () => {
6464
dispatchContext.sendDispatch({});
65-
expect(dispatchFn).toHaveBeenCalledWith({});
65+
expect(dispatchFn).not.toHaveBeenCalledWith({});
6666
});
6767

6868
test('Should be able to send updated state', () => {
@@ -79,6 +79,7 @@ describe('Dev Tools Extension (Without Extension)', () => {
7979

8080
test('Should be able to unsubscribe on tab close', () => {
8181
window.dispatchEvent(new Event('beforeunload'));
82+
dispatchContext.disconnectDevTools();
8283
expect(devDisconnect).not.toHaveBeenCalled();
8384
});
8485
})

0 commit comments

Comments
 (0)