chore: Configureer vitest

Configuratie en voorbeeldtesten
This commit is contained in:
Tibo De Peuter 2025-02-20 14:02:33 +01:00
parent df2f26482c
commit db4d6288d8
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
2 changed files with 21 additions and 12 deletions

View file

@ -0,0 +1,9 @@
import { describe, it, expect } from "vitest";
describe("Sample test", () => {
it("should sum to 2", () => {
const expected = 2;
const result = 1 + 1;
expect(result).toBe(expected);
});
})

View file

@ -1,14 +1,14 @@
import { fileURLToPath } from 'node:url'
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
import viteConfig from './vite.config'
import { fileURLToPath } from 'node:url';
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config';
import viteConfig from './vite.config';
export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/**'],
root: fileURLToPath(new URL('./', import.meta.url)),
},
}),
)
viteConfig,
defineConfig({
test: {
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/**'],
root: fileURLToPath(new URL('./', import.meta.url)),
},
}),
);