From b73b7e2c4308abada6ac1665a4b336a1a3046b39 Mon Sep 17 00:00:00 2001 From: Greg Leonard <45019882+greg-el@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:23:35 +0100 Subject: [PATCH] Add default timeout to unit test tracker --- libraries/browser-tracker-core/test/helpers/index.ts | 3 ++- .../browser-tracker-core/test/tracker/browser_context.test.ts | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/browser-tracker-core/test/helpers/index.ts b/libraries/browser-tracker-core/test/helpers/index.ts index b2a617fc3..e15a5c5db 100644 --- a/libraries/browser-tracker-core/test/helpers/index.ts +++ b/libraries/browser-tracker-core/test/helpers/index.ts @@ -75,7 +75,8 @@ export function createTestSessionIdCookie(params?: CreateTestSessionIdCookie) { return `_sp_ses.${domainHash}=*; Expires=; Path=/; SameSite=None; Secure;`; } +const DEFAULT_CONFIG: Partial = { connectionTimeout: 0 }; export function createTracker(configuration?: TrackerConfiguration) { let id = 'sp-' + Math.random(); - return addTracker(id, id, '', '', new SharedState(), configuration); + return addTracker(id, id, '', '', new SharedState(), { ...DEFAULT_CONFIG, ...configuration }); } diff --git a/libraries/browser-tracker-core/test/tracker/browser_context.test.ts b/libraries/browser-tracker-core/test/tracker/browser_context.test.ts index 4b4a09fea..2a831f1dd 100644 --- a/libraries/browser-tracker-core/test/tracker/browser_context.test.ts +++ b/libraries/browser-tracker-core/test/tracker/browser_context.test.ts @@ -24,7 +24,6 @@ describe('Browser context:', () => { const tracker = createTracker({ encodeBase64: false, contexts: { browser: true }, - connectionTimeout: 1, plugins: [ { afterTrack: (payload) => { @@ -47,7 +46,6 @@ describe('Browser context:', () => { it('Does not send the browser context entity by default', (done) => { const tracker = createTracker({ encodeBase64: false, - connectionTimeout: 1, plugins: [ { afterTrack: (payload) => {