fix: Return proper error objects for HTTP errors

This commit is contained in:
Michael Vines
2020-08-17 12:42:39 -07:00
parent 2f3ae52e8f
commit 967d6e0e3d
2 changed files with 8 additions and 1 deletions

View File

@ -74,6 +74,9 @@ const mock: JestMockFn<any, any> = jest.fn((fetchUrl, fetchOptions) => {
mockResponse,
);
return {
ok: true,
status: 200,
statusText: 'OK',
text: () => {
return Promise.resolve(JSON.stringify(response));
},