Skip to content

Using mocha.report in .vscode-test.js results in "Test process exited unexpectedly" error on "Run Tests" #313

@sewe

Description

@sewe

To Reproduce:

  1. Follow https://code.visualstudio.com/api/get-started/your-first-extension to create a simple, unbundled TypeScript-based extension
  2. Follow https://code.visualstudio.com/api/working-with-extensions/testing-extension to set up vscode-test
  3. Select src/test/extension.test.ts and choose Run Tests from the context menu
  4. This shows a successfully executing Sample test in the TEST RESULTS window
  5. Edit .vscode-test.mjs by adding the following
    mocha: {
      reporter: "Spec"
    }
  6. Select src/test/extension.test.tsagain and choose Run Tests from the context menu
  7. This shows an error for Sample test

    Test process exited unexpectedly, view output

In particular, this masks any real test failures. All tests are shown as failures because of this.

Running with a configured mocha.reporter on the command-line (via pnpm test in my case) works as expected.

Versions:

  • "@vscode/test-cli": "^0.0.10",
  • "@vscode/test-electron": "^2.5.
  • Version: 1.101.2
  • Commit: 2901c5ac6db8a986a5666c3af51ff804d05af0d4
  • Date: 2025-06-24T20:27:15.391Z
  • Electron: 35.5.1
  • ElectronBuildId: 11727614
  • Chromium: 134.0.6998.205
  • Node.js: 22.15.1
  • V8: 13.4.114.21-electron.0
  • OS: Linux x64 6.11.0-28-generic snap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions