jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.83k stars 291 forks source link

"Click to run tests" doesn't work on Jest v30 #1109

Closed h-yon closed 1 month ago

h-yon commented 7 months ago

Environment

  1. vscode-jest version: v6.1.2 (pre-release)
  2. node -v: v20.11.0
  3. npm -v or yarn --version: yarn 4.1.0
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected):
    ❯ yarn info jest
    └─ jest@npm:30.0.0-alpha.2
       ├─ Instances: 1
       ├─ Version: 30.0.0-alpha.2
       │ 
       ├─ Exported Binaries
       │  └─ jest
       │ 
       └─ Dependencies
          ├─ @jest/core@npm:30.0.0-alpha.2 → npm:30.0.0-alpha.2
          ├─ @jest/types@npm:30.0.0-alpha.2 → npm:30.0.0-alpha.2
          ├─ import-local@npm:^3.0.2 → npm:3.1.0
          └─ jest-cli@npm:30.0.0-alpha.2 → npm:30.0.0-alpha.2
  5. your vscode-jest settings if customized:
    • "jest.jestCommandLine": "yarn test"
  6. Operating system: Mac

Prerequisite

Steps to Reproduce

  1. click on ▶️ button on left side on line number field on test script (or run command "Test: Run Test at Cursor")

Expected Behavior

test is run

Actual Behavior

error below is shown on "test results" tab

TestRun "***" started
testPathPattern:

  Option "testPathPattern" was replaced by "testPathPatterns".

  Please update your configuration.

  CLI Options Documentation:
  https://jestjs.io/docs/cli
connectdotz commented 7 months ago

Thanks for bringing this to our attention. It looks like there might be non-trivial work required to support the upcoming Jest v30. We shall start looking into it after releasing v6 to production.

connectdotz commented 7 months ago

@SimenB, regarding preparing the extension for the upcoming Jest v30: Upon reviewing the release changelogs, I've noticed quite a few breaking changes, some of which will require us to modify our code, as highlighted by the issue mentioned here.

I'm concerned there might be other issues related to Jest v30 that we are not yet aware of. I have a few questions I hope you can help answer, which will assist us in plotting a path to support the new release:

  1. Is there a draft migration guide available for the Jest tooling community so we can better prepare for and support the new release?
  2. Considering the current alpha release, is it stable enough for us to begin implementing the necessary changes? Additionally, do you have a high-level timeline for when v30 will be officially released to production?
SimenB commented 7 months ago

Hey! 👋

  1. No, not at the moment. I was planning to do a general upgrade guide, not one specifically for tooling. I think it'd cover all use cases. I should probably get started on that...
  2. Yeah, I think so. I don't currently have plans for further breaking changes. Getting a release out is mainly writing the upgrade guide and blog post. Plus resolving https://github.com/jestjs/jest/issues/14726
johnwiseheart commented 4 months ago

Hey folks, I ran into this issue earlier in the week when trying to get vscode working for our jest tests running on jest v30. Was curious if there was any updates about the timeline for fixing this issue? I'd be happy to help out if its pretty straightforward!

connectdotz commented 4 months ago

@johnwiseheart, thanks for the offer. Unfortunately, the change might not be trivial. We might need to introduce version-aware changes. I am still waiting for the major issue (jestjs/jest#14726) before starting this work. Will let you know if we can use your help. 🙏

johnwiseheart commented 4 months ago

No problem! I'll see if I can help move forward the issue on the jest side :)

connectdotz commented 1 month ago

Hey everyone,

The fix is out! Check out the pre-release v6.3.0-next and let us know if you run into any issues.