v2.0.0
🚨 Breaking Changes
- Move Nitro config to second argument of
defineConfig- by @johannschopplich (5ad1b)
📖 Migration Guide
Nitro options as second argument
Nitro v3 ships an official Vite plugin (nitro/vite) that claims the nitro key on Vite's UserConfig for server configuration. Since nitro-test-utils v1 used the same key for test runner configuration, this caused a TypeScript type collision when both packages were used together (#20).
defineConfig now accepts the Nitro test options as a second argument instead of a key on the Vite config. This eliminates the module augmentation entirely – no shared key, no collision, no risk of this happening again.
The update is a one-line change. Move the nitro config object from inside the first argument to the second:
import { defineConfig } from 'nitro-test-utils/config'
-export default defineConfig({
- nitro: {
- global: true,
- },
-})
+export default defineConfig({}, {
+ global: true,
+})If you're using custom options, the same pattern applies:
-export default defineConfig({
- nitro: {
- global: {
- rootDir: 'backend',
- mode: 'production',
- },
- rerunOnSourceChanges: false,
- },
-})
+export default defineConfig({}, {
+ global: {
+ rootDir: 'backend',
+ mode: 'production',
+ },
+ rerunOnSourceChanges: false,
+})