15 lines
298 B
TypeScript
15 lines
298 B
TypeScript
/**
|
|
* 测试环境设置
|
|
*/
|
|
import { expect, afterEach } from 'vitest';
|
|
import { cleanup } from '@testing-library/react';
|
|
import matchers from '@testing-library/jest-dom/matchers';
|
|
|
|
// 扩展 Vitest 的 expect
|
|
expect.extend(matchers);
|
|
|
|
// 每次测试后清理
|
|
afterEach(() => {
|
|
cleanup();
|
|
});
|