Repository: nuxt/nuxt
File: vitest.config.ts (TypeScript)

Code before:
          dir: './test/nuxt/universal',
          environment: 'nuxt',
          environmentOptions: {
            nuxt: {
              overrides: { pages: false },
            },
          },
        },
      }),
      await defineVitestProject({
        test: {
          name: 'nuxt',
          dir: './test/nuxt',
          exclude: [...defaultExclude, '**/universal/**'],
          environment: 'nuxt',
          setupFiles: ['./test/setup-runtime.ts'],
          environmentOptions: {
            nuxt: {
              overrides: {
                routeRules: {
                  '/specific-prerendered': { prerender: true },
                  '/pre/test': { redirect: '/' },
                  '/pre/**': { prerender: true },
                },
                experimental: {
                  appManifest: process.env.TEST_MANIFEST !== 'manifest-off',
                },
                imports: {
                  polyfills: false,
                },
              },
            },
          },
        },
      }),
      await defineVitestProject({
        test: {
          name: 'nuxt-legacy',
          dir: './test/nuxt',
          exclude: [...defaultExclude, '**/universal/**'],
          environment: 'nuxt',
          setupFiles: ['./test/setup-runtime.ts'],
          env: {
            NUXT_LEGACY: '1',
          },
          environmentOptions: {
            nuxt: {
              overrides: {
                pages: true,
                routeRules: {
                  '/specific-prerendered': { prerender: true },

Review comment (suggestion):
feels like maybe we could move the unit tests outside of the test matrix entirely, in favour of just creating an additional project (you can leave this with me if you want)

Code after:
          benchmark: { include: [] },
        },
      },
      {
        resolve: {
          alias: {
            '#build/nuxt.config.mjs': resolve('./test/mocks/nuxt-config'),
            '#build/router.options': resolve('./test/mocks/router-options'),
            '#internal/nuxt/paths': resolve('./test/mocks/paths'),
            '#build/app.config.mjs': resolve('./test/mocks/app-config'),
            '#app': resolve('./packages/nuxt/dist/app'),
          },
        },
        test: {
          name: 'unit',
          benchmark: { include: [] },
          setupFiles: ['./test/setup-env.ts'],
          include: ['packages/**/*.test.ts'],
          testTimeout: isWindows ? 60000 : 10000,
          // Excluded plugin because it should throw an error when accidentally loaded via Nuxt
          exclude: [...configDefaults.exclude, 'test/e2e/**', 'e2e/**', 'nuxt/**', '**/test.ts', '**/this-should-not-load.spec.js'],
        },
      },
      await defineVitestProject({
        test: {
          name: 'nuxt-universal',
          dir: './test/nuxt/universal',
          environment: 'nuxt',
          environmentOptions: {
            nuxt: {
              overrides: { pages: false },
            },
          },
        },
      }),
      ...await Promise.all(Object.entries(projects).map(([project, config]) => defineVitestProject({
        test: {
          name: project,
          dir: './test/nuxt',
          exclude: [...defaultExclude, '**/universal/**'],
          environment: 'nuxt',
          setupFiles: ['./test/setup-runtime.ts'],
          env: {
            PROJECT: project,
          },
          environmentOptions: {
            nuxt: {
              overrides: defu(config, commonSettings),
            },
          },
        },