Skip to content

Commit

Permalink
add install
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Oct 26, 2022
1 parent 4cbe69c commit df8d60e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -127,10 +128,10 @@ describe('standalone bundle', () => {
// @ts-ignore ignore Response required fields
.mockImplementation((): Promise<Response> => 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'
)
})

Expand All @@ -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))
})
Expand Down

0 comments on commit df8d60e

Please sign in to comment.