microsoft / vscode-extension-samples

Sample code illustrating the VS Code extension API.
MIT License
8.58k stars 3.37k forks source link

helloworld-test-sample: tests don't work in debugger view #197

Open madelineliao opened 5 years ago

madelineliao commented 5 years ago

Running npm run test from the command line runs the sample test suite, which passes successfully, although I do get the following warning:

Downloading VS Code 1.36.1 from https://update.code.visualstudio.com/1.36.1/linux-x64/stable
Downloaded VS Code 1.36.1 into .vscode-test/vscode-1.36.1
[main 2019-07-17T22:49:22.771Z] update#setState idle

bash: cannot set terminal process group (-1): Invalid argument
bash: no job control in this shell

However, when I try to run tests from the debugger view in VSCode, I get the following error in the debug console:

Error: Error: Cannot find module '\home\t-maliao\vscode-extension-samples\helloworld-test-sample\out\test\suite\index'
    at D._doHandleExtensionTests (c:\Users\t-maliao\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:751:543)
    at D._handleExtensionTests (c:\Users\t-maliao\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:750:852)
    at define._startExtensionHost._readyToStartExtensionHost.wait.then.then.then (c:\Users\t-maliao\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:138)
extensionHostProcess.js:750
Error: write EPIPE
    at WriteWrap.afterWrite [as oncomplete] (net.js:788:14)
Emitted 'error' event at:
    at onwriteError (_stream_writable.js:431:12)
    at onwrite (_stream_writable.js:456:5)
    at _destroy (internal/streams/destroy.js:40:7)
    at Socket._destroy (net.js:613:3)
    at Socket.destroy (internal/streams/destroy.js:32:8)
    at WriteWrap.afterWrite [as oncomplete] (net.js:790:10)

Not sure if this has to do with the new vscode-test api?

octref commented 5 years ago

@madelineliao Does \out\test\suite\index.js exist on your disk? Also does it make a difference if you change this line in launch.json:

"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"

to

"--extensionTestsPath=${workspaceFolder}/out/test/suite"

or

"--extensionTestsPath=${workspaceFolder}/out/test/suite/index.js"