diff --git a/.vitest.config/jsx-runtime-default.ts b/.vitest.config/jsx-runtime-default.ts index 9885a19ba8..b6e497dc88 100644 --- a/.vitest.config/jsx-runtime-default.ts +++ b/.vitest.config/jsx-runtime-default.ts @@ -1,4 +1,5 @@ import config from '../vitest.config' + config.esbuild = { jsx: 'automatic', jsxImportSource: __dirname + '/../src/jsx', @@ -8,5 +9,8 @@ if (config.test) { '**/src/jsx/dom/**/(*.)+(spec|test).+(ts|tsx|js)', 'src/jsx/hooks/dom.test.tsx', ] + if (config.test.coverage) { + config.test.coverage.reportsDirectory = './coverage/raw/jsx-runtime' + } } export default config diff --git a/.vitest.config/jsx-runtime-dom.ts b/.vitest.config/jsx-runtime-dom.ts index 11adf6ccf0..c9a4a3a71e 100644 --- a/.vitest.config/jsx-runtime-dom.ts +++ b/.vitest.config/jsx-runtime-dom.ts @@ -8,5 +8,8 @@ if (config.test) { '**/src/jsx/dom/**/(*.)+(spec|test).+(ts|tsx|js)', 'src/jsx/hooks/dom.test.tsx', ] + if (config.test.coverage) { + config.test.coverage.reportsDirectory = './coverage/raw/jsx-dom' + } } export default config diff --git a/runtime_tests/bun/vitest.config.ts b/runtime_tests/bun/vitest.config.ts index 5d244e3f17..6b1cae417a 100644 --- a/runtime_tests/bun/vitest.config.ts +++ b/runtime_tests/bun/vitest.config.ts @@ -1,9 +1,14 @@ /// import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ test: { globals: true, include: ['**/runtime_tests/bun/**/*.+(ts|tsx|js)'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-bun', + }, }, }) diff --git a/runtime_tests/fastly/vitest.config.ts b/runtime_tests/fastly/vitest.config.ts index 89baa35770..c0480b1398 100644 --- a/runtime_tests/fastly/vitest.config.ts +++ b/runtime_tests/fastly/vitest.config.ts @@ -1,6 +1,7 @@ /// import fastlyCompute from 'vite-plugin-fastly-js-compute' import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ plugins: [fastlyCompute()], @@ -8,5 +9,9 @@ export default defineConfig({ globals: true, include: ['**/runtime_tests/fastly/**/(*.)+(test).+(ts|tsx)'], exclude: ['**/runtime_tests/fastly/vitest.config.ts'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-fastly', + }, }, }) diff --git a/runtime_tests/lambda-edge/vitest.config.ts b/runtime_tests/lambda-edge/vitest.config.ts index 568ecc05cf..105ac9505a 100644 --- a/runtime_tests/lambda-edge/vitest.config.ts +++ b/runtime_tests/lambda-edge/vitest.config.ts @@ -1,5 +1,6 @@ /// import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ test: { @@ -9,5 +10,9 @@ export default defineConfig({ globals: true, include: ['**/runtime_tests/lambda-edge/**/*.+(ts|tsx|js)'], exclude: ['**/runtime_tests/lambda-edge/vitest.config.ts'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-lambda-edge', + }, }, }) diff --git a/runtime_tests/lambda/vitest.config.ts b/runtime_tests/lambda/vitest.config.ts index 0fd446dc69..f030cf4107 100644 --- a/runtime_tests/lambda/vitest.config.ts +++ b/runtime_tests/lambda/vitest.config.ts @@ -1,5 +1,6 @@ /// import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ test: { @@ -9,5 +10,9 @@ export default defineConfig({ globals: true, include: ['**/runtime_tests/lambda/**/*.+(ts|tsx|js)'], exclude: ['**/runtime_tests/lambda/vitest.config.ts', '**/runtime_tests/lambda/mock.ts'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-lambda', + }, }, }) diff --git a/runtime_tests/node/vitest.config.ts b/runtime_tests/node/vitest.config.ts index a2c74bbbed..5387c11fde 100644 --- a/runtime_tests/node/vitest.config.ts +++ b/runtime_tests/node/vitest.config.ts @@ -1,5 +1,6 @@ /// import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ test: { @@ -9,5 +10,9 @@ export default defineConfig({ globals: true, include: ['**/runtime_tests/node/**/*.+(ts|tsx|js)'], exclude: ['**/runtime_tests/node/vitest.config.ts'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-node', + }, }, }) diff --git a/runtime_tests/wrangler/vitest.config.ts b/runtime_tests/wrangler/vitest.config.ts index 4b8af9b110..7eb5c620a1 100644 --- a/runtime_tests/wrangler/vitest.config.ts +++ b/runtime_tests/wrangler/vitest.config.ts @@ -1,10 +1,15 @@ /// import { defineConfig } from 'vitest/config' +import config from '../../vitest.config' export default defineConfig({ test: { globals: true, include: ['**/runtime_tests/wrangler/**/(*.)+(test).+(ts|tsx)'], exclude: ['**/runtime_tests/wrangler/vitest.config.ts'], + coverage: { + ...config.test?.coverage, + reportsDirectory: './coverage/raw/runtime-wrangler', + }, }, }) diff --git a/vitest.config.ts b/vitest.config.ts index 90470c8b36..471b29da6a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,6 +5,9 @@ export default defineConfig({ esbuild: { jsx: 'automatic', jsxImportSource: __dirname + '/../src/jsx', + // sourcemap: true, + // treeShaking: false, + // minify: false, }, test: { globals: true, @@ -12,8 +15,10 @@ export default defineConfig({ exclude: [...configDefaults.exclude, '**/sandbox/**', '**/*.case.test.+(ts|tsx|js)'], setupFiles: ['./src/test-utils/setup-vitest.ts'], coverage: { - provider: 'v8', - reporter: ['text'], + enabled: true, + provider: 'istanbul', + reportsDirectory: './coverage/raw/default', + reporter: ['json'], }, pool: 'forks', },