microsoft / vscode-test

Testing utility for VS Code extensions
MIT License
246 stars 59 forks source link

Mocha parallel mode issue #253

Closed AlexCannonball closed 11 months ago

AlexCannonball commented 11 months ago

Hello,

My tests are working fine in Mocha serial mode on Windows. However, if I try parallel mode in test/suite/index.ts like this:

export async function run(): Promise<void> {
  const mocha = new Mocha({
    parallel: true,
    jobs: 2,
    ui: 'bdd',
    checkLeaks: true,
    color: true,
    inlineDiffs: true,
    reporter: 'min'
  });
...

I'm getting an error:

Uncaught Error: Cannot find module 'vscode'

What am I doing wrong?

connor4312 commented 11 months ago

Mocha runs parallel-mode tests in separate worker processes. These cannot access the VS Code API, and doing so is unfortunately not possible.