chore: Configureer vitest
Configuratie en voorbeeldtesten
This commit is contained in:
parent
df2f26482c
commit
db4d6288d8
2 changed files with 21 additions and 12 deletions
9
backend/tests/example.test.ts
Normal file
9
backend/tests/example.test.ts
Normal 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);
|
||||||
|
});
|
||||||
|
})
|
|
@ -1,14 +1,14 @@
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url';
|
||||||
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
|
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config';
|
||||||
import viteConfig from './vite.config'
|
import viteConfig from './vite.config';
|
||||||
|
|
||||||
export default mergeConfig(
|
export default mergeConfig(
|
||||||
viteConfig,
|
viteConfig,
|
||||||
defineConfig({
|
defineConfig({
|
||||||
test: {
|
test: {
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
exclude: [...configDefaults.exclude, 'e2e/**'],
|
exclude: [...configDefaults.exclude, 'e2e/**'],
|
||||||
root: fileURLToPath(new URL('./', import.meta.url)),
|
root: fileURLToPath(new URL('./', import.meta.url)),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
)
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue