-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathgetReplayId.test.ts
More file actions
33 lines (26 loc) · 746 Bytes
/
getReplayId.test.ts
File metadata and controls
33 lines (26 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @vitest-environment jsdom
*/
import '../utils/mock-internal-setTimeout';
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
import { mockSdk } from '../mocks/mockSdk';
describe('Integration | getReplayId', () => {
beforeAll(() => {
vi.useFakeTimers();
});
afterEach(() => {
vi.clearAllMocks();
});
it('works', async () => {
const { integration, replay } = await mockSdk({
replayOptions: {
stickySession: true,
},
});
expect(integration.getReplayId()).toBeDefined();
expect(integration.getReplayId()).toEqual(replay.session?.id);
// When stopped, it is undefined
integration.stop();
expect(integration.getReplayId()).toBeUndefined();
});
});