-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Labels
Description
Environment
- Operating System: Darwin
- Node Version: v22.14.0
- Nuxt Version: -
- CLI Version: 3.25.1
- Nitro Version: -
- Package Manager: [email protected]
- Builder: -
- User Config: -
- Runtime Modules: -
- Build Modules: -
Reproduction
https://github.com/daugvinasr/nuxt-repro
Describe the bug
Inside a monorepo nuxt/test-utils ignores provided runner (jsdom) and always defaults to happy-dom.
vitest.config.ts
import { defineVitestConfig } from '@nuxt/test-utils/config'
export default defineVitestConfig({
test: {
runner: 'jsdom',
include: ['**\/*.{test,spec}.?(c|m)[jt]s?(x)']
}
})Logs
➜ nuxt-repro git:(main) pnpm --filter iframe test
> iframe@ test /Users/daugvinas/Projects/nuxt-repro/apps/iframe
> vitest
DEV v3.1.4 /Users/daugvinas/Projects/nuxt-repro/apps/iframe
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: TestRunner is not a constructor
❯ resolveTestRunner ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/index.Cu2UlluP.js:38:21
❯ processTicksAndRejections node:internal/process/task_queues:105:5
❯ run ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/runBaseTests.BV8m0B-u.js:106:17
❯ runBaseTests ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/base.DslwPSCy.js:35:2
❯ ForksBaseWorker.executeTests ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/workers/forks.js:27:4
❯ execute ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/worker.js:113:3
❯ onMessage ../../node_modules/.pnpm/[email protected]/node_modules/tinypool/dist/entry/process.js:55:20
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Test Files (1)
Tests no tests
Errors 1 error
Start at 10:09:06
Duration 331ms (transform 21ms, setup 0ms, collect 0ms, tests 0ms, environment 0ms, prepare 0ms)
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit