test-utils
test-utils copied to clipboard
e2e tests dont show any console logs in stdout and in vitest/ui
Environment
------------------------------
- Operating System: Darwin
- Node Version: v21.6.1
- Nuxt Version: 3.11.0
- CLI Version: 3.10.1
- Nitro Version: 2.9.4
- Package Manager: [email protected]
- Builder: -
- User Config: -
- Runtime Modules: -
- Build Modules: -
------------------------------
Reproduction
https://stackblitz.com/edit/github-krtpdn?file=test%2Fsomething.spec.ts
Describe the bug
Using console.log() within an e2e test doesnt output the test in stdout as well as in devtools "Console" tab. Only seems to work for beforeAll().
Try:
-
bun run test-> No logs in console -
bun run dev, then open devtools -> Vitest
No logs in tab "Console"
Logs
No response
I just spent a couple of hours with a similar problem. Turns out, the nuxt-security module removes all loggers.
Any chance you're using that too?
https://nuxt-security.vercel.app/utils/remove-console-loggers