microsoft / vscode-test

Testing utility for VS Code extensions
MIT License
238 stars 57 forks source link

TypeError: Cannot read property 'describe' of undefined #134

Open lovettchris opened 2 years ago

lovettchris commented 2 years ago

I have the weirdest problem with this error. I get it from a bare bones "cmd.exe" on my machine and in my github ci on "windows-latest". But if I run the test in VS code using my Extension Tests - lean3 launch configuration it runs fine, and if I run it from a Visual Studio Developer Command prompt it runs fine (but I should totally not need a vs developer prompt to run these tests). The repro is this:

  1. git clone git@github.com:leanprover/vscode-lean4.git
  2. npm install
  3. npx lerna bootstrap
  4. npm run build
  5. npm run test

The test begins, it downloads a test version of vscode, vscode launches, but then the mocha.run blows up with this error:

TypeError: Cannot read property 'describe' of undefined

My tests are "ui: tdd" tests which is specified in my index.ts so I'm not sure why it's even looking for describe...

But here's the most ridiculous part. If I run this

Windows+r "c:\windows\system32\cmd.exe"

then type this:

pushd d:\git\leanprover\vscode-lean4
npm run test

Then the tests run fine, no problem with mocha. Even weirder, if I do this:

Windows+r "c:\windows\system32\cmd.exe"

Then type:

d:
cd git\leanprover\vscode-lean4
npm run test

It seems to have something to do with the casing of the "D:" drive letter? If I run "pushd D:\git\leanprover\vscode-lean4" then the test fails...

lovettchris commented 2 years ago

Since this may be a mocha bug I filed this: https://github.com/mochajs/mocha/issues/4851