You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
610 B
TypeScript
25 lines
610 B
TypeScript
|
9 months ago
|
// Learn more: https://github.com/testing-library/jest-dom
|
||
|
|
import "@testing-library/jest-dom";
|
||
|
|
|
||
|
|
global.fetch = jest.fn(() =>
|
||
|
|
Promise.resolve({
|
||
|
|
ok: true,
|
||
|
|
status: 200,
|
||
|
|
json: () => Promise.resolve({}),
|
||
|
|
headers: new Headers(),
|
||
|
|
redirected: false,
|
||
|
|
statusText: "OK",
|
||
|
|
type: "basic",
|
||
|
|
url: "",
|
||
|
|
clone: function () {
|
||
|
|
return this;
|
||
|
|
},
|
||
|
|
body: null,
|
||
|
|
bodyUsed: false,
|
||
|
|
arrayBuffer: () => Promise.resolve(new ArrayBuffer(0)),
|
||
|
|
blob: () => Promise.resolve(new Blob()),
|
||
|
|
formData: () => Promise.resolve(new FormData()),
|
||
|
|
text: () => Promise.resolve(""),
|
||
|
|
}),
|
||
|
|
);
|