11import { Observable , deepClone } from '@datadog/browser-core'
22import { registerCleanupTask } from '../../../../core/test'
33import { mockRumConfiguration , setupLocationObserver } from '../../../test'
4- import type { LifeCycle } from '../lifeCycle'
5- import { LifeCycleEventType } from '../lifeCycle'
4+ import { LifeCycle , LifeCycleEventType } from '../lifeCycle'
65import type { RumConfiguration } from '../configuration'
76import type { RumMutationRecord } from '../../browser/domMutationObservable'
87import type { ViewCreatedEvent , ViewEvent , ViewOptions , ViewEndedEvent } from './trackViews'
@@ -11,15 +10,15 @@ import { trackViews } from './trackViews'
1110export type ViewTest = ReturnType < typeof setupViewTest >
1211
1312interface ViewTrackingContext {
14- lifeCycle : LifeCycle
1513 initialLocation ?: string
1614 partialConfig ?: Partial < RumConfiguration >
1715}
1816
1917export function setupViewTest (
20- { lifeCycle , initialLocation, partialConfig } : ViewTrackingContext ,
18+ { initialLocation, partialConfig } : ViewTrackingContext = { } ,
2119 initialViewOptions ?: ViewOptions
2220) {
21+ const lifeCycle = new LifeCycle ( )
2322 const domMutationObservable = new Observable < RumMutationRecord [ ] > ( )
2423 const windowOpenObservable = new Observable < void > ( )
2524 const configuration = mockRumConfiguration ( partialConfig )
@@ -61,6 +60,7 @@ export function setupViewTest(
6160 registerCleanupTask ( stop )
6261
6362 return {
63+ lifeCycle,
6464 startView,
6565 setViewContext,
6666 setViewContextProperty,
0 commit comments