Skip to content

when using debug to print to console, output is missing on reruns #1768

@panick-carousel

Description

@panick-carousel

Describe the bug

I am using the debug tool with vitest and cannot reliably get output from this tool. It appears as tho when in watch mode, vitest clears the console and wipes any debug output under some circumstances.

the debug library writes to stderr rather than stdout, so perhaps the clearing code in vite should account for lines due to stderr somehow ?

Thank you kindly for vitest - it makes life so much better.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-qiyvqq?file=test%2Fsuite.test.ts,package.json&initialPath=__vitest__

In terminal, press enter to trigger test reruns and observe the output to console from the debug() library.

Then start editing any file to trigger a test rerun, and observe the output to console from debug() is removed.

System Info

System:
    OS: Linux 5.17 Fedora Linux 36 (Server Edition)
    CPU: (16) x64 Intel(R) Xeon(R) E-2286M  CPU @ 2.40GHz
    Memory: 14.55 GB / 19.53 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.6.0 - /run/user/1001/fnm_multishells/788267_1659397396823/bin/node
    Yarn: 1.22.19 - /run/user/1001/fnm_multishells/788267_1659397396823/bin/yarn
    npm: 8.13.2 - /run/user/1001/fnm_multishells/788267_1659397396823/bin/npm

Used Package Manager

yarn

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions