Skip to content

Commit b84bf34

Browse files
committed
Increase init test coverage
1 parent e7fc704 commit b84bf34

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/modules/Instabug.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('Instabug Module', () => {
137137
await waitForExpect(() => expect(NativeInstabug.reportScreenChange).toBeCalledTimes(2));
138138
});
139139

140-
it('should call the native method init', () => {
140+
it('should call the native method init with optional parameters set', () => {
141141
const instabugConfig = {
142142
token: 'some-token',
143143
invocationEvents: [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake],
@@ -155,6 +155,22 @@ describe('Instabug Module', () => {
155155
);
156156
});
157157

158+
it('should call the native method init with default optional parameters', () => {
159+
const instabugConfig = {
160+
token: 'some-token',
161+
invocationEvents: [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake],
162+
};
163+
Instabug.init(instabugConfig);
164+
165+
expect(NativeInstabug.init).toBeCalledTimes(1);
166+
expect(NativeInstabug.init).toBeCalledWith(
167+
instabugConfig.token,
168+
instabugConfig.invocationEvents,
169+
'',
170+
LogLevel.Error,
171+
);
172+
});
173+
158174
it('should report the first screen on SDK initialization', async () => {
159175
Instabug.init({ token: 'some-token' });
160176

0 commit comments

Comments
 (0)