Skip to content

Commit c97e6b8

Browse files
authored
Update gabledroofbug.test.js
1 parent fc5a643 commit c97e6b8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/gabledroofbug.test.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ const data = `
3434

3535
let accessCount = 0;
3636

37-
global.fetch = jest.fn(() =>
38-
Promise.resolve({
39-
json: () => Promise.resolve({ text: data}),
40-
ok: true,
41-
status: 200,
42-
}),
43-
);
37+
const mockResponse = {
38+
ok: true,
39+
status: 200,
40+
text: jest.fn().mockResolvedValue(data),
41+
};
42+
global.fetch = jest.fn().mockResolvedValue(mockResponse);
4443

4544
beforeEach(() => {
4645
errors = [];

0 commit comments

Comments
 (0)