Skip to content

Add infrastructure for VS Code extension tests #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 12, 2025

Conversation

juliasilge
Copy link
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
runBuild({
const testBuildOptions = {
entryPoints: testFiles,
outdir: 'test-out',
Copy link
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
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.

@juliasilge
Copy link
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
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
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
Copy link
Contributor

@cscheid cscheid left a comment

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
Copy link
Collaborator

vezwork commented Jul 17, 2025

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