Vscode-jest: v4.0 plan

Created on 29 Apr 2020  ·  24Comments  ·  Source: jest-community/vscode-jest

Moving toward the next major (awesome) version:

enhancement

  • [x] better start-up setting config. This is one of the major pain points. Moving toward a more interactive/wizard-like interface to set up settings like jest.pathToConfig with users' input. (#571, #244, #565, #556, #618 too many to list...) => #590 => #655

    • [x] jest-community/jest-editor-support#44 - Rename pathToJest

    • [x] added new jest setting jest.jestCommandLine into code base. (#644)

  • [x] better test matching logic: #484, #570, #491, #597, #648 => #593 (available alpha.0)
  • [x] fixed coverage issue

    • [x] coverage map generation/merge issues (#559, #551, #524) and update really old 3rd party dependencies => #588 (available alpha.0)

    • [x] formaters related issues: #411, #586, #585 => #635

  • [x] move test status indicators outside of the code, so it won't interfere with formatting. (#554) => #599
  • [x] support parameterized tests (#427, #612) => #649
  • [x] support manual and enhanced watch mode (#613, #668, #119, #308, #176, #408, #530, #36, #574...) => #674

technical debt

  • [x] upgrade dependencies, for better security and maintainability. => #583 (available alpha.0)
  • [x] migrate from tslint to eslint => #583 (available alpha.0)
  • [x] adopt ";" :-) => #583 (available alpha.0)
  • [x] better troubleshooting and help documentation/examples (#544) => #674, #655
  • [ ] auto close staled issues/PR so we can better focus on the active ones.

release

v4.0.0-alpha.5 is the latest release and we are now finally feature-complete!


suggestion and discussion are welcome

Most helpful comment

I am not sure if this is the correct threat to write this but I think as a feature request for v4 should be cool to have a list of the tests in with an icon in the left bar:

this bar:
image

with a list like the one webstorm generates:
image

where when someone double clicks on a test name, the cursor goes to that test (not just for failing tests).

All 24 comments

I am not sure if this is the correct threat to write this but I think as a feature request for v4 should be cool to have a list of the tests in with an icon in the left bar:

this bar:
image

with a list like the one webstorm generates:
image

where when someone double clicks on a test name, the cursor goes to that test (not just for failing tests).

@distante I think it is a great idea, but not sure if we can squeeze it in v4, as it already has a lot of changes... feel free to submit it as a separate feature request and hopefully we can get to it soon after v4.

I missed to start the discussion as part of #583, but taking into account https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/, what's your point of view on using tabs over spaces?

hello, v4.0.0-alpha.0 is available for early testing now.

This release contains coverage and test status matching improvement. Feel free to give it a spin and let us know if you see any issue.

@stephtr regarding tab vs space... it's a valid point but clearly comes with trade-off... given our contributor community is relatively small (unlike our user community) and I haven't heard about tab/space complaint, so my gut feeling is not to change it now until we bumped into an actual issue...

Is there any chance I can get #625 in the next release (assuming 4.0 is the next)?

given our contributor community is relatively small

Given the above, let me know if there are any tasks outstanding for this release and I might be able to take a look at them.

625 might need more discussion, I have commented there.

I think the remaining critical missing feature for 4.0 is #590... it would be great if you can help with that!

I've been using the 4.0 release for about a month now and all around it seems to be much more reliable. Moving the status indicators in particular has helped a lot. Thank you!

v4.0.0-alpha.3 is released today. The main change is to support the parameterized tests. If your project uses parameterized tests, feel free to give this release a try.

This is looking great so far. The coverage issues all seem resolved. Moving the indicator into the gutter took a bit of getting used to, but now I'm loving it and it is much more reliable. Great job all.

v4.0.0-alpha.5 is released today and we are finally feature-complete for v4. This is probably the one with the most changes among all alpha releases, i.e. it needs more testing, especially for windows environments...

If you are interested in non-watchman-driven testing or simply want to control when to run your tests, please feel free to give the latest release a try and let us know how it works for you.

@connectdotz I've been trialing this today on our very large repo (~500 test suites, ~1500 tests) and it works really well! I've been having issues with watch mode - when changing one file, many tests would re-run and the new ⌘ + T shortcut to run tests is a huge time saver. however,

  "jest.autoRun": {
    "onSave": "test-src-file"
  }

does not trigger test runs for me. I can file a separate issue if needed.

hey @Talor-A thanks for trying out the new release, glad it helped your project. Regarding the jest.autoRun, try this instead:

"jest.autoRun": {
   "watch": false,
    "onSave": "test-src-file"
  }

we could enhance the pattern recognition later, but right now it requires explicit "watch" property.

It is looking good to me so far. The wizard did not pick up my "jest.pathToConfig": "jest.config.local.js", setting though. It was in the vscode workspace settings.json if that helps. I manually set "jest.jestCommandLine": "npx jest -c jest.config.local.js", and it seems to be working just fine now.

@markcarroll thanks for testing the latest version.

The wizard did not pick up my "jest.pathToConfig": "jest.config.local.js", setting though. It was in the vscode workspace settings.json if that helps.

That's odd... do you also have jest.pathToJest or just the jest.pathToConfig prior to starting the wizard?

hey @Talor-A thanks for trying out the new release, glad it helped your project. Regarding the jest.autoRun, try this instead:

"jest.autoRun": {

   "watch": false,

    "onSave": "test-src-file"

  }

we could enhance the pattern recognition later, but right now it requires explicit "watch" property.

Just tried this and it did work but still seemed to have the issue of running many tests for one changed source file. Curious if you have docs on how test files are linked to "related" source files or vice versa? I'm guessing this is more of an issue with our large repo than with the jest extension itself, though. And regardless running individual tests fixes the problem for me so I'm quite excited for the final 4.0! Thanks for all the hard work that's gone into this release!

@markcarroll thanks for testing the latest version.

The wizard did not pick up my "jest.pathToConfig": "jest.config.local.js", setting though. It was in the vscode workspace settings.json if that helps.

That's odd... do you also have jest.pathToJest or just the jest.pathToConfig prior to starting the wizard?

I only had the jest.pathToConfig not the other one. Maybe that was it.

@Talor-A

Just tried this and it did work but still seemed to have the issue of running many tests for one changed source file.

I suspected this could happen, as we did use jest to figure out the "related" tests, which most likely used the dependency tree. You could consider using the "test-file" instead of "test-src-file", so it will automatically run a single test file when it itself changed:

"jest.autoRun": {
   "watch": false,
    "onSave": "test-file"
  }

The downside is you will have to trigger the desired test file run by hand when only the src file changed, but that is what you are doing with the complete manual run anyway, so this approach kind of sitting in between.

@markcarroll

I only had the jest.pathToConfig not the other one. Maybe that was it.

that explains it... yes the wizard considered this case as "unconfigured", so it will prompt you to enter the command you usually used. However, you should be able to type in npx jest -c jest.config.local.js in the field without manually editing the settings.json yourself... Please let us know if the instruction or the process is not clear enough, I know it's trivial for people already familiar with the extension settings like yourself, but we are hoping this tool can also help the newcomers.

Are you able to debug tests with the config generated by the wizard?

Yes that is exactly what I put in there: npx jest -c jest.config.local.js and it is working perfectly. Debugging works great.

We have not seen any issue regarding alpha-5 so far, but before we prmote it to marketplace, would like to know if anybody has run it on windows platform yet?

Hmm... it has been quiet here. I guess while it is safer to sit with alpha forever, eventually, we will have to move forward to the real world. I will release v4 to the marketplace and stand by to fix issues...

@orta @stephtr If you have any alternative suggestions or concerns, please do so asap.

Yeah, I think that's probably the right call 👍🏻

ok, it is live now...

any future discussion regarding this release can be moved to release discussion #693

Big thanks to everyone who made this possible!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karb0f0s picture karb0f0s  ·  37Comments

connectdotz picture connectdotz  ·  37Comments

bnwan picture bnwan  ·  28Comments

qwerty2k picture qwerty2k  ·  26Comments

luisrudge picture luisrudge  ·  27Comments