Skip to content

Commit

Permalink
Simplify the test
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn committed Dec 28, 2023
1 parent 59a943d commit 95eca74
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/client-web/__tests__/integration/web_connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { createClient } from '../../src'
import type { WebClickHouseClient } from '../../src/client'

describe('[Web] Connection', () => {
let fetchSpy: jasmine.Spy<typeof window.fetch>
beforeEach(() => {
fetchSpy = spyOn(window, 'fetch').and.returnValue(
Promise.resolve(stubResponse())
)
})

describe('KeepAlive setting', () => {
let fetchSpy: jasmine.Spy<typeof window.fetch>
beforeEach(() => {
fetchSpy = spyOn(window, 'fetch').and.returnValue(
Promise.resolve(new Response())
)
})

it('should be enabled by default', async () => {
const client = createClient()
const fetchParams = await pingAndGetRequestInit(client)
Expand All @@ -35,8 +35,4 @@ describe('[Web] Connection', () => {
return fetchParams!
}
})

function stubResponse() {
return new Response()
}
})

0 comments on commit 95eca74

Please sign in to comment.