0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 19:26:56 +01:00
hono/vitest.config.ts
TATSUNO “Taz” Yasuhiro 8cc8a05c89
ci: Report coverage with CodeCov (#2862)
* Output coverage per each test

* Collect coverage

* Exclude test-only files

* update comment

* exclude types

* Add config

* Update bun comment

* Generate coverage in Deno
2024-06-01 04:17:47 +09:00

31 lines
879 B
TypeScript

/// <reference types="vitest" />
import { configDefaults, defineConfig } from 'vitest/config'
export default defineConfig({
esbuild: {
jsx: 'automatic',
jsxImportSource: __dirname + '/../src/jsx',
},
test: {
globals: true,
include: ['**/src/**/(*.)+(spec|test).+(ts|tsx|js)'],
exclude: [...configDefaults.exclude, '**/sandbox/**', '**/*.case.test.+(ts|tsx|js)'],
setupFiles: ['./src/test-utils/setup-vitest.ts'],
coverage: {
enabled: true,
provider: 'v8',
reportsDirectory: './coverage/raw/default',
reporter: ['json'],
exclude: [
...(configDefaults.coverage.exclude ?? []),
'benchmarks',
'runtime_tests',
'build.ts',
'src/test-utils',
'src/**/types.ts', // types are compile-time only, so their coverage cannot be measured
]
},
pool: 'forks',
},
})