feat: Use Vitest for testing (#25284)

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
NerivecandKoen Kanters authored and GitHub committed 2024-12-22 20:19:45 +01:00
1 parent 5d059b7bcb
commit 06f44533af
51 files changed
+2606 -4771

No files matched your search

+10 -4
View File
@@ -290,10 +290,16 @@ export function read(): ReturnType<typeof yaml.read> {
return yaml.read(path.join(mockDir, 'configuration.yaml'));
}
jest.mock('../../lib/util/data', () => ({
joinPath: (file: string): string => jest.requireActual('node:path').join(mockDir, file),
getPath: (): string => mockDir,
}));
vi.mock('../../lib/util/data', async () => {
const nodePath = await vi.importActual<typeof import('node:path')>('node:path');
return {
default: {
joinPath: (file: string): string => nodePath.join(mockDir, file),
getPath: (): string => mockDir,
},
};
});
writeDefaultConfiguration();
writeDefaultState();