nuxt / nuxt/test-utils

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

Open
#795 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

Description

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:  bun@1.0.29
- 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
  1. bun run dev, then open devtools -> Vitest

No logs in tab "Console"

Bildschirmfoto 2024-03-19 um 16 13 11
Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open test/something.spec.ts from the StackBlitz reproduction and run bun run test; compare with bun run dev and the Vitest UI Console tab. Trace the e2e test logging path and verify that console.log output appears in stdout and the UI, not only from beforeAll().

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, nuxt, typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.