AP
Size: a a a
AP
VL
IK
M
findByLabel()
и без expect
после него.DP
M
DP
M
M
clearMocks: true
beforeAll
я делаю мок. Потом у меня два теста.IK
IK
M
IK
IK
IK
IK
IK
M
describe("httpRequest", () => {
beforeAll(() => {
fetch = jest.fn();
});
it("doesn't fetch whe no url", () => {
httpRequest();
expect(fetch).not.toHaveBeenCalled();
});
it("fetches whe there is url", () => {
httpRequest("https://example.com");
expect(fetch).toHaveBeenCalled();
});
});