test: use linkedom in jest for tests

This commit is contained in:
thecodrr
2022-07-15 09:44:47 +05:00
parent 0a05ec3cbd
commit 854ffaa8c4

View File

@@ -1,8 +1,10 @@
var nodeCrypto = require("crypto"); var nodeCrypto = require("crypto");
var dotenv = require("dotenv"); var dotenv = require("dotenv");
const fetch = require("node-fetch"); const fetch = require("node-fetch");
const linkedom = require("linkedom");
globalThis.DOMParser = linkedom.DOMParser;
globalThis.fetch = fetch; globalThis.fetch = fetch;
require("abortcontroller-polyfill/dist/polyfill-patch-fetch") require("abortcontroller-polyfill/dist/polyfill-patch-fetch");
dotenv.config(); dotenv.config();