|
1 | 1 | import type { RelativeTime } from '@datadog/browser-core' |
2 | 2 | import { HookNames } from '@datadog/browser-core' |
3 | | -import { mockSyntheticsWorkerValues, startMockTelemetry } from '@datadog/browser-core/test' |
| 3 | +import { mockSyntheticsWorkerValues } from '@datadog/browser-core/test' |
4 | 4 | import type { Hooks } from '../hooks' |
5 | 5 | import { createHooks } from '../hooks' |
6 | 6 | import { startRUMInternalContext } from './rumInternalContext' |
7 | 7 |
|
8 | 8 | describe('startRUMInternalContext', () => { |
9 | 9 | let hooks: Hooks |
10 | | - let stopRUMInternalContext: () => void |
11 | 10 |
|
12 | 11 | beforeEach(() => { |
13 | 12 | hooks = createHooks() |
14 | | - ;({ stop: stopRUMInternalContext } = startRUMInternalContext(hooks)) |
| 13 | + startRUMInternalContext(hooks) |
15 | 14 | }) |
16 | 15 |
|
17 | 16 | afterEach(() => { |
18 | 17 | delete window.DD_RUM |
19 | 18 | delete window.DD_RUM_SYNTHETICS |
20 | | - stopRUMInternalContext() |
21 | 19 | }) |
22 | 20 |
|
23 | 21 | describe('assemble hook', () => { |
@@ -61,33 +59,6 @@ describe('startRUMInternalContext', () => { |
61 | 59 | }) |
62 | 60 | expect(defaultLogsEventAttributes).toEqual({ foo: 'bar' }) |
63 | 61 | }) |
64 | | - |
65 | | - it('adds a telemetry debug event when RUM has not been injected yet', async () => { |
66 | | - const telemetry = startMockTelemetry() |
67 | | - hooks.triggerHook(HookNames.Assemble, { |
68 | | - startTime: 0 as RelativeTime, |
69 | | - }) |
70 | | - expect(await telemetry.getEvents()).toEqual([ |
71 | | - jasmine.objectContaining({ |
72 | | - message: 'Logs sent before RUM is injected by the synthetics worker', |
73 | | - status: 'debug', |
74 | | - type: 'log', |
75 | | - testId: 'test-id', |
76 | | - resultId: 'result-id', |
77 | | - }), |
78 | | - ]) |
79 | | - }) |
80 | | - |
81 | | - it('adds the telemetry debug event only once', async () => { |
82 | | - const telemetry = startMockTelemetry() |
83 | | - hooks.triggerHook(HookNames.Assemble, { |
84 | | - startTime: 0 as RelativeTime, |
85 | | - }) |
86 | | - hooks.triggerHook(HookNames.Assemble, { |
87 | | - startTime: 0 as RelativeTime, |
88 | | - }) |
89 | | - expect((await telemetry.getEvents()).length).toEqual(1) |
90 | | - }) |
91 | 62 | }) |
92 | 63 | }) |
93 | 64 |
|
|
0 commit comments