|
1 | | -import NativeSessionReplayReactNative from '../NativeSessionReplayReactNative' |
2 | | -import { configureSessionReplay, createSessionReplayPlugin } from '../index' |
| 1 | +import NativeSessionReplayReactNative from '../NativeSessionReplayReactNative'; |
| 2 | +import { configureSessionReplay, createSessionReplayPlugin } from '../index'; |
3 | 3 |
|
4 | 4 | jest.mock('../NativeSessionReplayReactNative', () => ({ |
5 | 5 | configure: jest.fn().mockResolvedValue(undefined), |
6 | 6 | startSessionReplay: jest.fn().mockResolvedValue(undefined), |
7 | 7 | stopSessionReplay: jest.fn().mockResolvedValue(undefined), |
8 | | -})) |
| 8 | +})); |
9 | 9 |
|
10 | 10 | describe('configureSessionReplay', () => { |
11 | 11 | it('rejects if key is empty', async () => { |
12 | | - await expect(configureSessionReplay('')).rejects.toThrow() |
13 | | - }) |
| 12 | + await expect(configureSessionReplay('')).rejects.toThrow(); |
| 13 | + }); |
14 | 14 |
|
15 | 15 | it('rejects if key is whitespace', async () => { |
16 | | - await expect(configureSessionReplay(' ')).rejects.toThrow() |
17 | | - }) |
18 | | -}) |
| 16 | + await expect(configureSessionReplay(' ')).rejects.toThrow(); |
| 17 | + }); |
| 18 | +}); |
19 | 19 |
|
20 | 20 | describe('SessionReplayPluginAdapter', () => { |
21 | 21 | it('calls configure and startSessionReplay on register', async () => { |
22 | | - const plugin = createSessionReplayPlugin() |
23 | | - plugin.register({}, { sdk: { name: 'test', version: '0.0.0' }, mobileKey: 'mob-key-123' }) |
| 22 | + const plugin = createSessionReplayPlugin(); |
| 23 | + plugin.register( |
| 24 | + {}, |
| 25 | + { sdk: { name: 'test', version: '0.0.0' }, mobileKey: 'mob-key-123' } |
| 26 | + ); |
24 | 27 |
|
25 | | - await new Promise(process.nextTick) |
| 28 | + await new Promise(process.nextTick); |
26 | 29 |
|
27 | 30 | expect(NativeSessionReplayReactNative.configure).toHaveBeenCalledWith( |
28 | 31 | 'mob-key-123', |
29 | 32 | {} |
30 | | - ) |
31 | | - expect(NativeSessionReplayReactNative.startSessionReplay).toHaveBeenCalled() |
32 | | - }) |
33 | | -}) |
| 33 | + ); |
| 34 | + expect( |
| 35 | + NativeSessionReplayReactNative.startSessionReplay |
| 36 | + ).toHaveBeenCalled(); |
| 37 | + }); |
| 38 | +}); |
0 commit comments