Skip to content

Commit

Permalink
Add default timeout to unit test tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-el committed Oct 17, 2023
1 parent 96e1163 commit b73b7e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libraries/browser-tracker-core/test/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export function createTestSessionIdCookie(params?: CreateTestSessionIdCookie) {
return `_sp_ses.${domainHash}=*; Expires=; Path=/; SameSite=None; Secure;`;
}

const DEFAULT_CONFIG: Partial<TrackerConfiguration> = { 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 });
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('Browser context:', () => {
const tracker = createTracker({
encodeBase64: false,
contexts: { browser: true },
connectionTimeout: 1,
plugins: [
{
afterTrack: (payload) => {
Expand All @@ -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) => {
Expand Down

0 comments on commit b73b7e2

Please sign in to comment.