Skip to content

How to run vitest in noninteractive mode? #9333

@khteh

Description

@khteh

Describe the bug

Script:

"test": "export NODE_ENV=test PORT=4433&& vitest",

At the end of the run, it waits for user input:

       press h to show help, press q to quit

This doesn't work well in CI/CD.

Reproduction

"test": "export NODE_ENV=test PORT=4433&& vitest",
$ n run test

System Info

System:
    OS: Linux 6.17 Ubuntu 25.10 25.10 (Questing Quokka)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz
    Memory: 39.03 GB / 68.13 GB
    Container: Yes
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 25.2.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /home/khteh/.yarn/bin/yarn
    npm: 11.7.0 - /usr/local/bin/npm
    pnpm: 8.7.6 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 143.0.7499.169
    Firefox: 146.0.1
    Firefox Developer Edition: 146.0.1
  npmPackages:
    @vitest/coverage-v8: ^4.0.15 => 4.0.15 
    vitest: ^4.0.15 => 4.0.15

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions