raycast-linux/vitest-setup-client.ts
ByteAtATime a26cd8c3fe
test(frontend): add vitest for unit and component testing
This commit introduces a complete testing setup using Vitest. It's configured it to handle both unit tests in a Node environment and component tests using JSDOM. The `vite.config.js` now defines two separate test projects ('client' and 'server') to manage these different environments. Lastly, to ensure the testing environment is setup correctly, it adds tests for the CommandPalette extension
2025-07-06 15:09:06 -07:00

20 lines
404 B
TypeScript

import '@testing-library/jest-dom/vitest';
import { beforeAll } from 'vitest';
/// <reference types="@vitest/browser/matchers" />
/// <reference types="@vitest/browser/providers/playwright" />
beforeAll(() => {
// TODO: better method?
global.ResizeObserver = class ResizeObserver {
observe() {
// do nothing
}
unobserve() {
// do nothing
}
disconnect() {
// do nothing
}
};
});