setupTests.ts 353 B

12345678910111213
  1. import "@testing-library/jest-dom";
  2. import "jest-canvas-mock";
  3. jest.mock("nanoid", () => {
  4. return {
  5. nanoid: jest.fn(() => "test-id"),
  6. };
  7. });
  8. // ReactDOM is located inside index.tsx file
  9. // as a result, we need a place for it to render into
  10. const element = document.createElement("div");
  11. element.id = "root";
  12. document.body.appendChild(element);