Skip to content

Add infrastructure for VS Code extension tests - #757

Merged
juliasilge merged 10 commits into
mainfrom
vscode-test-infrastructure
Jul 12, 2025
Merged

Add infrastructure for VS Code extension tests#757
juliasilge merged 10 commits into
mainfrom
vscode-test-infrastructure

Conversation

@juliasilge

Copy link
Copy Markdown
Collaborator

We want to get some first infrastructure set up here, so we can start writing extension level tests: https://code.visualstudio.com/api/working-with-extensions/testing-extension

@juliasilge juliasilge changed the title WIP: Add infrastructure for VS Code extension tests Add infrastructure for VS Code extension tests Jul 10, 2025
@juliasilge juliasilge changed the title Add infrastructure for VS Code extension tests WIP: Add infrastructure for VS Code extension tests Jul 10, 2025
Comment thread apps/vscode/build.ts
Comment thread apps/vscode/build.ts
runBuild({
const testBuildOptions = {
entryPoints: testFiles,
outdir: 'test-out',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates the test .js files in the directory where we can tell the vscode-test cli where to find them.


export default defineConfig([
{
files: 'test-out/*.test.js',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where we tell the vscode-test cli where to find the files.

Comment thread apps/vscode/src/test/toggle.test.ts Outdated
Comment thread apps/vscode/src/test/toggle.test.ts Outdated
@juliasilge

Copy link
Copy Markdown
Collaborator Author

As of my writing now, to compile and run the tests:

  • start from apps/vscode for the working directory
  • yarn run build test to compile the tests
  • yarn test to run the tests

@juliasilge

Copy link
Copy Markdown
Collaborator Author

Now it's just yarn test from the working directory of the VS Code extension.

@juliasilge juliasilge changed the title WIP: Add infrastructure for VS Code extension tests Add infrastructure for VS Code extension tests Jul 11, 2025
@juliasilge
juliasilge marked this pull request as ready for review July 11, 2025 23:12
@juliasilge

Copy link
Copy Markdown
Collaborator Author

I did it! 🎉 I have one very simple test, and tools to run that both locally and in CI.

@juliasilge
juliasilge requested a review from cscheid July 11, 2025 23:13

@cscheid cscheid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited about this PR!

Everything looks good from what I can tell. It also seems very low risk to just merge this, given it doesn't really interact with the other parts of the code base. If the CI action acts up, we can just disable the workflow.

@juliasilge
juliasilge merged commit 0424deb into main Jul 12, 2025
2 checks passed
@juliasilge
juliasilge deleted the vscode-test-infrastructure branch July 12, 2025 02:57
@vezwork

vezwork commented Jul 17, 2025

Copy link
Copy Markdown
Member

Tested yarn test-vscode in main and it worked! :) Exciting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants