chore(cli): configure vitest

This commit is contained in:
Ayo Ayco 2024-12-07 10:29:31 +01:00
parent f77f78f459
commit b1778d09f9
4 changed files with 661 additions and 6 deletions

5
.gitignore vendored
View file

@ -1,11 +1,16 @@
dist dist
node_modules node_modules
coverage
html
*.log* *.log*
.nitro .nitro
.cache .cache
.output .output
.env .env
*~ *~
*swp *swp
*swo *swo
mcfly-app mcfly-app

View file

@ -8,7 +8,9 @@
"mcfly": "./index.js" "mcfly": "./index.js"
}, },
"scripts": { "scripts": {
"test": "vitest" "test": "vitest",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,6 +29,9 @@
"consola": "^3.2.3" "consola": "^3.2.3"
}, },
"devDependencies": { "devDependencies": {
"@vitest/coverage-istanbul": "2.1.8",
"@vitest/coverage-v8": "2.1.8",
"@vitest/ui": "2.1.8",
"nitropack": "2.8", "nitropack": "2.8",
"vitest": "^2.1.8" "vitest": "^2.1.8"
} }

View file

@ -1,7 +1,14 @@
import {defineConfig} from 'vitest/config'; import {coverageConfigDefaults, defineConfig} from 'vitest/config';
export default defineConfig({ export default defineConfig({
test: { test: {
globals: true, globals: true,
reporters: ['html'],
coverage: {
enabled: true,
provider: 'v8',
reporter: 'html',
exclude: ['html/**', ...coverageConfigDefaults.exclude]
}
}, },
}) })

File diff suppressed because it is too large Load diff