Skip to content

Commit 4507afb

Browse files
committed
test: set status of the fetch Response
1 parent 69dbc3d commit 4507afb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/utils/src/http-client/http-client.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpClientCreateOptions, HttpClient } from './http-client'
1+
import { HttpClient, HttpClientCreateOptions } from './http-client'
22

33
describe('HttpClient', () => {
44
it('should configure base url', async () => {
@@ -124,7 +124,7 @@ describe('HttpClient', () => {
124124
method: 'GET'
125125
},
126126
result: '',
127-
status: undefined
127+
status: 200
128128
})
129129
})
130130
})
@@ -135,7 +135,8 @@ function setup<T>(options?: HttpClientCreateOptions & Partial<{ result: T }>) {
135135
Promise.resolve({
136136
text: () => Promise.resolve(JSON.stringify(options?.result ?? { foo: 'bar' })),
137137
ok: true,
138-
headers: new Headers()
138+
headers: new Headers(),
139+
status: 200
139140
})
140141
)
141142
window.fetch = fetchMock

0 commit comments

Comments
 (0)