microsoft / microsoft/vscode-extension-samples
webpack-sample: include extension test example
@jrieken is already working on this.
Since Jul 14, 2021.
- Dominant language
- TypeScript
- Stars
- 10.2k
- Forks
- 3.9k
- PR merge metrics
- No merged PRs in 30d
Description
I have difficulties with setting up extension tests when using webpack.
It looks like there was a test sample before, but now it's gone.
Would be nice if the example contains the best practice / example when webpack is in use.
In particular, I want to learn:
-
How to set up the
preLaunchTaskfor Extension Tests correctly inlaunch.json: Currently Extension Tests configuration is using"npm: test-compile", that invokes only"tsc -p ./".package.jsonpoints to the webpacked"./dist/extension"as the extension main. As a result, when the task starts, it's possible that the test runs the webpacked version built with a stale version of code. -
How to set breakpoints in the extension code (
src/*.ts) when debugging a test using the "Extension Tests" configuration:
Breakpoints set in the main extension source code (src/*.ts) sometimes never hit. Not sure if that's related to the fact the runTest is loading the webpacked version or whether some javascript optimization gets involved. Example to demonstrate how to make it work correctly is greatly appreciated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.