From df8d60e4929668f4fddf1bbac5568d1f2c02768e Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:48:29 -0500 Subject: [PATCH] add install --- .../src/browser/__tests__/standalone-analytics.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/browser/src/browser/__tests__/standalone-analytics.test.ts b/packages/browser/src/browser/__tests__/standalone-analytics.test.ts index 67acd5c93..caab21f9c 100644 --- a/packages/browser/src/browser/__tests__/standalone-analytics.test.ts +++ b/packages/browser/src/browser/__tests__/standalone-analytics.test.ts @@ -7,6 +7,7 @@ import unfetch from 'unfetch' import { PersistedPriorityQueue } from '../../lib/priority-queue/persisted' import { sleep } from '../../test-helpers/sleep' import * as Factory from '../../test-helpers/factories' +import { setGlobalCDNUrl } from '../../lib/parse-cdn' const track = jest.fn() const identify = jest.fn() @@ -127,10 +128,10 @@ describe('standalone bundle', () => { // @ts-ignore ignore Response required fields .mockImplementation((): Promise => fetchSettings) - await AnalyticsBrowser.standalone('my-write-key') + await install() expect(unfetch).toHaveBeenCalledWith( - 'https://cdn.foo.com/v1/projects/my-write-key/settings' + 'https://cdn.foo.com/v1/projects/foo/settings' ) }) @@ -142,7 +143,7 @@ describe('standalone bundle', () => { const mockCdn = 'http://my-overridden-cdn.com' window.analytics._cdn = mockCdn - await AnalyticsBrowser.standalone('abc') + await install() expect(unfetch).toHaveBeenCalledWith(expect.stringContaining(mockCdn)) })