Skip to content

Commit 077f2ec

Browse files
committed
Increase init test coverage
1 parent af457ab commit 077f2ec

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/modules/Instabug.spec.ts

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

169-
it('should call the native method init', () => {
169+
it('should call the native method init with optional parameters set', () => {
170170
const instabugConfig = {
171171
token: 'some-token',
172172
invocationEvents: [InvocationEvent.floatingButton, InvocationEvent.shake],
@@ -184,6 +184,22 @@ describe('Instabug Module', () => {
184184
);
185185
});
186186

187+
it('should call the native method init with default optional parameters', () => {
188+
const instabugConfig = {
189+
token: 'some-token',
190+
invocationEvents: [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake],
191+
};
192+
Instabug.init(instabugConfig);
193+
194+
expect(NativeInstabug.init).toBeCalledTimes(1);
195+
expect(NativeInstabug.init).toBeCalledWith(
196+
instabugConfig.token,
197+
instabugConfig.invocationEvents,
198+
'',
199+
LogLevel.Error,
200+
);
201+
});
202+
187203
it('should report the first screen on SDK initialization', async () => {
188204
Instabug.init({
189205
token: 'some-token',

0 commit comments

Comments
 (0)