Fixing rest test mocking.

This commit is contained in:
mike12345567 2021-11-03 15:45:19 +00:00
parent 9ce1866fab
commit 24b2036e09
1 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,11 @@
jest.mock("node-fetch", () => jest.mock("node-fetch", () =>
jest.fn(() => ({ json: jest.fn(), text: jest.fn() })) jest.fn(() => ({
headers: {
get: () => ["application/json"]
},
json: jest.fn(),
text: jest.fn()
}))
) )
const fetch = require("node-fetch") const fetch = require("node-fetch")
const RestIntegration = require("../rest") const RestIntegration = require("../rest")