Skip to content

Commit 8795661

Browse files
authored
Update gabledroofbug.test.js
1 parent e164d76 commit 8795661

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
@@ -32,13 +32,12 @@ const data = `
3232
</osm>`;
3333

3434
let accessCount = 0;
35-
global.fetch = function(input) {
36-
accessCount++;
37-
if (accessCount === 1) {
38-
return data;
39-
}
40-
throw new Error(input);
41-
};
35+
36+
global.fetch = jest.fn(() =>
37+
Promise.resolve({
38+
json: () => Promise.resolve({ data: data}),
39+
})
40+
);
4241

4342
beforeEach(() => {
4443
errors = [];

0 commit comments

Comments
 (0)