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

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

Closed
h-yon opened this issue Feb 7, 2024 · 7 comments · Fixed by #1153
Closed

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

h-yon opened this issue Feb 7, 2024 · 7 comments · Fixed by #1153
Labels
enhancement external-dependency has dependency on external issues/fixes

Comments

@h-yon
Copy link

h-yon commented Feb 7, 2024

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

  • are you able to run jest test from the command line? yes
  • how do you run your tests from the command line? yarn jest

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

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

@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
Copy link
Member

SimenB commented Mar 1, 2024

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 [Bug]: v30 alpha: testPathPatterns that worked in the past not working any more. jestjs/jest#14726

@johnwiseheart
Copy link

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

@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. 🙏

@connectdotz connectdotz added the external-dependency has dependency on external issues/fixes label May 27, 2024
@johnwiseheart
Copy link

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

@connectdotz
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement external-dependency has dependency on external issues/fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants