UNPKG

create-decaf-webapp

Version:
24 lines (20 loc) 626 B
import matchers from '@testing-library/jest-dom/matchers'; import '@testing-library/jest-dom/vitest'; import { cleanup } from '@testing-library/react'; import { afterEach, expect } from 'vitest'; // https://github.com/ant-design/ant-design/issues/21096 Object.defineProperty(window, 'matchMedia', { value: () => { return { matches: false, addListener: () => {}, removeListener: () => {}, }; }, }); // extends Vitest's expect method with methods from react-testing-library expect.extend(matchers); // runs a cleanup after each test case (e.g. clearing jsdom) afterEach(() => { cleanup(); });