mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-29 02:14:10 +00:00

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
20 lines
404 B
TypeScript
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
|
|
}
|
|
};
|
|
});
|