microsoft / microsoft/vscode-test

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

Open
#313 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
316
Forks
73
Avg merge
1d 6h
Merged PRs (30d)
3

Description

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

Contributor guide

No contributing guide indexed for this repository

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

Start by reproducing the issue with the sample unbundled TypeScript extension, editing .vscode-test.mjs to add the Mocha reporter and running Run Tests. Compare this with the working pnpm test command; done means configured reporters work in Run Tests without turning every test into an unexpected process failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.