mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 07:52:10 +01:00
Migrate tests from Jest to Vitest, updating setup and test files accordingly.
- Replace Jest imports and mocks with Vitest equivalents in setup and unit tests. - Adjust test cases to use async imports and reset modules with Vitest. - Add Vitest configuration file for test environment setup and coverage reporting.
This commit is contained in:
23
vitest.config.mts
Normal file
23
vitest.config.mts
Normal file
@ -0,0 +1,23 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tsconfigPaths(), react()],
|
||||
test: {
|
||||
environment: 'node',
|
||||
globals: true,
|
||||
setupFiles: ['./tests/setup.ts'],
|
||||
include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
env: {
|
||||
NODE_ENV: 'test',
|
||||
},
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'lcov', 'html'],
|
||||
include: ['lib/**/*.ts'],
|
||||
exclude: ['lib/**/*.d.ts', 'lib/**/*.test.ts'],
|
||||
},
|
||||
testTimeout: 10000,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user