Considering which client side unit-testing framework to use in our company.
Would like to know what is the recommended way of using jest in visual studio 2017 environment? any available plugins? or should we run it using windows command line?
Thanks!
I'm not aware of any integrations, but maybe there are some? Also, I think you'll find more helpful answers through our Help page: https://facebook.github.io/jest/en/help.html
edit: don't be discouraged if this issue will be closed anytime soon, we try to keep it for bug reports and feature requests mostly
My basic question was how do you advise to use Jest and I did not receive an answer to that question thus probably this issue should be open (you can consider the integration request a feature request).
Regarding what you wrote, having some kind of integration would probably bring many more users to jest...
Jest is not mentioned at all in the visual studio docs:
http://taco.visualstudio.com/en-us/docs/unit-test-02-environments/
Having a test explorer adapter provides a good experience:
http://taco.visualstudio.com/en-us/docs/unit-test-04-chutzpah/
This could be a solution if it would be finished (since chutzpah has a test explorer adapter):
https://github.com/mmanela/chutzpah/issues/525
Im intresting too.
+1
It would be amazing to do a Jest plugin for Visual Studio 2017 馃槂
The debugger works in vscode. Can it be integrated in visual studio professional +?
It says here that some support was added to jest, anybody tested that? https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes#JSTS
Also interested too. Jest test integration in the Visual Studio 2017 Test Explorer would make my current testing much easier!
also interested!
This works as of VS2017 version 15.9. There's detailed info in https://docs.microsoft.com/en-us/visualstudio/javascript/unit-testing-javascript-with-visual-studio?view=vs-2017 regarding VS2017's built-in JS unit testing mechanism, although they haven't updated it to mention jest yet.
To get it working, I had to install the jest and jest-editor-support npm packages. Not sure if the "Node.js development" component in VS is required but I installed that too via Visual Studio Installer. Unit tests then appear in the Test Explorer.
Nice! At the bottom of that page is a link to an issue (https://github.com/MicrosoftDocs/visualstudio-docs/issues/1988) mentioning the need to add Jest - maybe you can comment there with your findings? 馃檪 I'm not sure how that repo works
As above, Jest partially works with Visual Studio 2017 and 2019, the glue between needs some work.
Here are my findings
@federicobarera the debugger works in 2019.
test discovery is not perfect
typescript works in certain scenarios.
@thcgit To get Jest to appear in the Test Explorer, did you have to add something like the following to your project file:
<PropertyGroup>
<JavaScriptTestRoot>tests\</JavaScriptTestRoot>
<JavaScriptTestFramework>Tape</JavaScriptTestFramework>
</PropertyGroup>
Yes, but the quality of this is a bit poor, it basically uses jest-editor-support which does not correctly resolve tests.
See https://github.com/MicrosoftDocs/visualstudio-docs/issues/1989
Most helpful comment
This works as of VS2017 version 15.9. There's detailed info in https://docs.microsoft.com/en-us/visualstudio/javascript/unit-testing-javascript-with-visual-studio?view=vs-2017 regarding VS2017's built-in JS unit testing mechanism, although they haven't updated it to mention jest yet.
To get it working, I had to install the jest and jest-editor-support npm packages. Not sure if the "Node.js development" component in VS is required but I installed that too via Visual Studio Installer. Unit tests then appear in the Test Explorer.