Skip to content

Commit df8d60e

Browse files
committed
add install
1 parent 4cbe69c commit df8d60e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/browser/src/browser/__tests__/standalone-analytics.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import unfetch from 'unfetch'
77
import { PersistedPriorityQueue } from '../../lib/priority-queue/persisted'
88
import { sleep } from '../../test-helpers/sleep'
99
import * as Factory from '../../test-helpers/factories'
10+
import { setGlobalCDNUrl } from '../../lib/parse-cdn'
1011

1112
const track = jest.fn()
1213
const identify = jest.fn()
@@ -127,10 +128,10 @@ describe('standalone bundle', () => {
127128
// @ts-ignore ignore Response required fields
128129
.mockImplementation((): Promise<Response> => fetchSettings)
129130

130-
await AnalyticsBrowser.standalone('my-write-key')
131+
await install()
131132

132133
expect(unfetch).toHaveBeenCalledWith(
133-
'https://cdn.foo.com/v1/projects/my-write-key/settings'
134+
'https://cdn.foo.com/v1/projects/foo/settings'
134135
)
135136
})
136137

@@ -142,7 +143,7 @@ describe('standalone bundle', () => {
142143
const mockCdn = 'http://my-overridden-cdn.com'
143144

144145
window.analytics._cdn = mockCdn
145-
await AnalyticsBrowser.standalone('abc')
146+
await install()
146147

147148
expect(unfetch).toHaveBeenCalledWith(expect.stringContaining(mockCdn))
148149
})

0 commit comments

Comments
 (0)