2020-02-11 23:19:43 +01:00
|
|
|
import "@testing-library/jest-dom";
|
|
|
|
import "jest-canvas-mock";
|
|
|
|
|
2021-11-24 16:25:19 +01:00
|
|
|
import dotenv from "dotenv";
|
|
|
|
|
|
|
|
// jest doesn't know of .env.development so we need to init it ourselves
|
|
|
|
dotenv.config({
|
|
|
|
path: require("path").resolve(__dirname, "../.env.development"),
|
|
|
|
});
|
|
|
|
|
2021-06-09 23:16:56 +02:00
|
|
|
jest.mock("nanoid", () => {
|
|
|
|
return {
|
|
|
|
nanoid: jest.fn(() => "test-id"),
|
|
|
|
};
|
|
|
|
});
|
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);
|