Skip to content

Commit

Permalink
test: set status of the fetch Response
Browse files Browse the repository at this point in the history
  • Loading branch information
achamorro-dev committed Nov 14, 2023
1 parent 69dbc3d commit 4507afb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/utils/src/http-client/http-client.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpClientCreateOptions, HttpClient } from './http-client'
import { HttpClient, HttpClientCreateOptions } from './http-client'

describe('HttpClient', () => {
it('should configure base url', async () => {
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('HttpClient', () => {
method: 'GET'
},
result: '',
status: undefined
status: 200
})
})
})
Expand All @@ -135,7 +135,8 @@ function setup<T>(options?: HttpClientCreateOptions & Partial<{ result: T }>) {
Promise.resolve({
text: () => Promise.resolve(JSON.stringify(options?.result ?? { foo: 'bar' })),
ok: true,
headers: new Headers()
headers: new Headers(),
status: 200
})
)
window.fetch = fetchMock
Expand Down

0 comments on commit 4507afb

Please sign in to comment.