kisp / react-create-vite-extended-template-generator

Template generator for "Start a new React + Vite + JS/TS app with ease"
1 stars 0 forks source link

Make sure that cleanup is called #25

Open kisp opened 6 months ago

kisp commented 6 months ago
import { expect, afterEach } from 'vitest';
import { cleanup } from '@testing-library/react';
import * as matchers from "@testing-library/jest-dom/matchers";
expect.extend(matchers);
afterEach(() => {
  cleanup();
});

https://testing-library.com/docs/react-testing-library/api/#cleanup

kisp commented 6 months ago
test: {
    globals: true,
    environment: "jsdom",
    setupFiles: "./tests/setup.ts",
  },