Skip to content
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

Add jest-runner-vscode #9542

Closed
wants to merge 1 commit into from
Closed

Add jest-runner-vscode #9542

wants to merge 1 commit into from

Conversation

bmealhouse
Copy link

Summary

Mocha is the only documented test runner for building VS Code extensions so I'm working with the VS Code team to have Jest documented as well (microsoft/vscode-docs#3363).

I would like to add jest-runner-vscode to the list of examples in the runner section of the Configuring Jest docs.

I'm also curious if this warrants a "Testing VS Code Extensions" under the Framework Guides in the sidebar?

Test plan

Screen Shot 2020-02-09 at 8 42 14 AM

@facebook-github-bot
Copy link
Contributor

Hi @bmealhouse!

Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@codecov-io
Copy link

Codecov Report

Merging #9542 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9542   +/-   ##
=======================================
  Coverage   65.03%   65.03%           
=======================================
  Files         283      283           
  Lines       12113    12113           
  Branches     3000     3000           
=======================================
  Hits         7878     7878           
  Misses       3597     3597           
  Partials      638      638

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 481077b...c26e6c2. Read the comment docs.

@SimenB
Copy link
Member

SimenB commented Feb 9, 2020

Hey! It seems like your runner is to actually run Jest itself? The runners linked are invoked by Jest to run some other tool. Seems like it's the wrong section?

I've never used VS Code, could you explain a bit about how your runner is to be used?

@bmealhouse
Copy link
Author

Hi @SimenB, thanks for the quick response!

Yes, jest-runner-vscode runs Jest programmatically (even though it's not officially supported). I can see how that would be confusing.

The purpose of the package is to use Jest as a test runner for VS Code extension integration tests. When running a VS Code extension integration test suite, VS Code starts a new instance VS Code (called the Extension Development Host), which has full access to the VS Code API. jest-runner-vscode implements the test runner script with @jest/core to run the tests. Using environment variables, it supports passing in a test regex, custom setup file, and updating snapshots. It gets the job done for now, but there is a lot of room for improvement.

Maybe a better name for the package would be vscode-jest-test-runner or something along those lines?

I've been using Jest for a long time now, and when I started building my VS Code extension, shifty, I was not happy with Mocha (the default test runner for VS Code extensions). Snapshot testing is extremely valuable to me! I want Jest to have a great testing story for VS Code extension development, so this is my initial work to make it easier for others.

Feel free to pull down the code for shifty and run the tests to see how it works. Alternatively, you could pull down the helloworld-jest-test-sample to test it out as well.

Let me know if you have any other questions or feedback.

@bmealhouse
Copy link
Author

@SimenB - I'm closing this PR since jest-runner-vscode is not actually invoked by Jest. I moved the package over to vscode-jest-test-runner for the time being.

@bmealhouse bmealhouse closed this Feb 16, 2020
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants