mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add additional test for HTTP status code
This commit is contained in:
@@ -63,6 +63,14 @@ describe("ApiBasedRepositoryLoader", () => {
|
|||||||
await loader.fetchAndUpdateSystemData();
|
await loader.fetchAndUpdateSystemData();
|
||||||
}).rejects.toThrow(ApiResponseError);
|
}).rejects.toThrow(ApiResponseError);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("throws the correct error if HTTP status code is not 200", async () => {
|
||||||
|
updateGlobalFetchMockJson(fetchSystemDataFailedResponse, 400);
|
||||||
|
|
||||||
|
await expect(async () => {
|
||||||
|
await loader.fetchAndUpdateSystemData();
|
||||||
|
}).rejects.toThrow(ApiResponseError);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("fetchAndUpdateRouteDataForExistingSystems", () => {
|
describe("fetchAndUpdateRouteDataForExistingSystems", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user