test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

e2e tests dont show any console logs in stdout and in vitest/ui

Open MickL opened this issue 1 year ago • 1 comments

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:

  1. bun run test -> No logs in console Bildschirmfoto 2024-03-19 um 16 15 57

  2. bun run dev, then open devtools -> Vitest

No logs in tab "Console"

Bildschirmfoto 2024-03-19 um 16 13 11

Logs

No response

MickL avatar Mar 19 '24 15:03 MickL

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

gehringf avatar Mar 13 '25 08:03 gehringf