Skip to content

Commit d30d518

Browse files
committed
🔀 Fix rebase issues: update imports for @datadog/js-core extraction, convert new debugger specs to Vitest
- Add @datadog/js-core/time alias to vitest.config.ts - Move time-related imports from @datadog/browser-core to @datadog/js-core/time across ~70 files - Convert display.spec.ts, probes.spec.ts (new from main) to Vitest - Re-convert deliveryApi.spec.ts and api.spec.ts from main (complete rewrite) - Fix allJsonSchemas.js require.context (removed .js/.d.ts, kept .ts with import.meta.glob) - Fix getTimeStamp → toTimeStamp rename - Fix getNavigationStart → getTimeOrigin rename - Remove supportPerformanceTimingEvent guard (removed on main)
1 parent 7f5b920 commit d30d518

85 files changed

Lines changed: 597 additions & 1400 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/browser-core/src/browser/cookieAccess.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { vi, describe, it, expect, type Mock } from 'vitest'
2+
import { dateNow, ONE_MINUTE } from '@datadog/js-core/time'
23
import { collectAsyncCalls, mockClock, registerCleanupTask, replaceMockable } from '../../test'
34
import type { Configuration } from '../domain/configuration'
45
import { display } from '../tools/display'
56
import { globalObject } from '../tools/globalObject'
67
import { detectVersion, isChromium } from '../tools/utils/browserDetection'
7-
import { dateNow, ONE_MINUTE } from '../tools/utils/timeUtils'
88
import type { CookieOptions } from './cookie'
99
import { deleteCookie, getCookie, setCookie } from './cookie'
1010
import type { CookieAccess } from './cookieAccess'

‎packages/browser-core/src/domain/bufferedData.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { vi, describe, expect, it } from 'vitest'
2+
import { clocksNow } from '@datadog/js-core/time'
23
import type { MockFetch } from '../../test'
34
import { collectAsyncCalls, mockFetch, mockXhr, registerCleanupTask, replaceMockable, withXhr } from '../../test'
45
import { Observable } from '../tools/observable'
56
import { resetFetchObservable } from '../browser/fetchObservable'
67
import { resetXhrObservable } from '../browser/xhrObservable'
7-
import { clocksNow } from '../tools/utils/timeUtils'
88
import { ConsoleApiName } from '../tools/display'
99
import { noop } from '../tools/utils/functionUtils'
1010
import { resetConsoleObservable } from './console/consoleObservable'

‎packages/browser-core/src/domain/contexts/accountContext.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { vi, beforeEach, describe, expect, it, type Mock } from 'vitest'
2+
import type { RelativeTime } from '@datadog/js-core/time'
23
import type { Hooks } from '../../../test'
34
import { createHooks, registerCleanupTask } from '../../../test'
45
import { mockRumConfiguration } from '../../../../browser-rum-core/test'
56
import type { ContextManager } from '../context/contextManager'
67
import { display } from '../../tools/display'
7-
import type { RelativeTime } from '../../tools/utils/timeUtils'
88
import { HookNames } from '../../tools/abstractHooks'
99
import { removeStorageListeners } from '../context/storeContextManager'
1010
import { startAccountContext } from './accountContext'

‎packages/browser-core/src/domain/contexts/globalContext.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { beforeEach, describe, expect, it } from 'vitest'
2+
import type { RelativeTime } from '@datadog/js-core/time'
23
import type { Hooks } from '../../../test'
34
import type { LogsConfiguration } from '../../../../browser-logs/src/domain/configuration'
45
import type { ContextManager } from '../context/contextManager'
56
import { HookNames } from '../../tools/abstractHooks'
6-
import type { RelativeTime } from '../../tools/utils/timeUtils'
77
import { createHooks, registerCleanupTask } from '../../../test'
88
import { removeStorageListeners } from '../context/storeContextManager'
99
import type { Configuration } from '../configuration'

‎packages/browser-core/src/domain/contexts/tabContext.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect, vi, beforeEach } from 'vitest'
2+
import type { RelativeTime } from '@datadog/js-core/time'
23
import type { Hooks } from '../../../test'
34
import { createHooks, registerCleanupTask } from '../../../test'
45
import { HookNames } from '../../tools/abstractHooks'
5-
import type { RelativeTime } from '../../tools/utils/timeUtils'
66
import { TAB_ID_STORAGE_KEY, resetCachedTabId, startTabContext } from './tabContext'
77

88
const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/

‎packages/browser-core/src/domain/contexts/telemetrySessionContext.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { vi, beforeEach, describe, expect, it } from 'vitest'
2+
import type { RelativeTime } from '@datadog/js-core/time'
23
import type { Hooks } from '../../../test'
34
import { createHooks, createSessionManagerMock, MOCK_SESSION_ID } from '../../../test'
4-
import type { RelativeTime } from '../../tools/utils/timeUtils'
55
import { HookNames } from '../../tools/abstractHooks'
66
import { startTelemetrySessionContext } from './telemetrySessionContext'
77

‎packages/browser-core/src/domain/contexts/userContext.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { beforeEach, describe, expect, it } from 'vitest'
2+
import type { RelativeTime } from '@datadog/js-core/time'
23
import type { Hooks } from '../../../test'
34
import { createHooks, registerCleanupTask } from '../../../test'
45
import { mockRumConfiguration } from '../../../../browser-rum-core/test'
56
import type { ContextManager } from '../context/contextManager'
6-
import type { RelativeTime } from '../../tools/utils/timeUtils'
77
import { HookNames } from '../../tools/abstractHooks'
88
import { removeStorageListeners } from '../context/storeContextManager'
99
import type { Configuration } from '../configuration'

‎packages/browser-core/src/domain/error/error.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest'
2-
import { clocksNow } from '../../tools/utils/timeUtils'
2+
import { clocksNow } from '@datadog/js-core/time'
33
import type { StackTrace } from '../../tools/stackTrace/computeStackTrace'
44
import { registerCleanupTask } from '../../../test'
55
import {

‎packages/browser-core/src/domain/eventRateLimiter/createEventRateLimiter.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { vi, beforeEach, describe, expect, it } from 'vitest'
2+
import { relativeToClocks, ONE_MINUTE } from '@datadog/js-core/time'
23
import type { Clock } from '../../../test'
34
import { mockClock } from '../../../test'
4-
import { relativeToClocks, ONE_MINUTE } from '../../tools/utils/timeUtils'
55
import { noop } from '../../tools/utils/functionUtils'
66
import type { RawError } from '../error/error.types'
77
import { createEventRateLimiter } from './createEventRateLimiter'

‎packages/browser-core/src/domain/session/sessionManager.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { vi, beforeEach, describe, expect, it, type Mock } from 'vitest'
2+
import { ONE_SECOND } from '@datadog/js-core/time'
23
import {
34
collectAsyncCalls,
45
createFakeSessionStoreStrategy,
@@ -15,7 +16,6 @@ import {
1516
import type { Clock } from '../../../test'
1617
import { DOM_EVENT } from '../../browser/addEventListener'
1718
import { display } from '../../tools/display'
18-
import { ONE_SECOND } from '../../tools/utils/timeUtils'
1919
import type { Configuration } from '../configuration'
2020
import type { TrackingConsentState } from '../trackingConsent'
2121
import { TrackingConsent, createTrackingConsentState } from '../trackingConsent'

0 commit comments

Comments
 (0)