2020-02-11 23:19:43 +01:00
|
|
|
import "@testing-library/jest-dom";
|
2023-07-26 19:04:06 +02:00
|
|
|
import "jest-canvas-mock";
|
|
|
|
import dotenv from "dotenv";
|
2022-08-11 16:46:25 +02:00
|
|
|
import polyfill from "./polyfill";
|
2021-11-24 16:25:19 +01:00
|
|
|
|
2022-11-04 13:52:21 +01:00
|
|
|
require("fake-indexeddb/auto");
|
|
|
|
|
2022-08-11 16:46:25 +02:00
|
|
|
polyfill();
|
2023-07-26 19:04:06 +02:00
|
|
|
// jest doesn't know of .env.development so we need to init it ourselves
|
|
|
|
dotenv.config({
|
|
|
|
path: require("path").resolve(__dirname, "../.env.development"),
|
|
|
|
});
|
2021-11-24 16:25:19 +01:00
|
|
|
|
2023-07-26 19:04:06 +02:00
|
|
|
jest.mock("nanoid", () => {
|
2021-06-09 23:16:56 +02:00
|
|
|
return {
|
2023-07-26 19:04:06 +02:00
|
|
|
nanoid: jest.fn(() => "test-id"),
|
2021-06-09 23:16:56 +02:00
|
|
|
};
|
|
|
|
});
|
2020-02-11 23:19:43 +01:00
|
|
|
// ReactDOM is located inside index.tsx file
|
|
|
|
// as a result, we need a place for it to render into
|
|
|
|
const element = document.createElement("div");
|
|
|
|
element.id = "root";
|
|
|
|
document.body.appendChild(element);
|