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

Updating ts-jest from 26.1.1 to 26.3.0 causes error with jest-util #1913

Closed
kimroen opened this issue Aug 31, 2020 · 2 comments · Fixed by #1914
Closed

Updating ts-jest from 26.1.1 to 26.3.0 causes error with jest-util #1913

kimroen opened this issue Aug 31, 2020 · 2 comments · Fixed by #1914
Labels
🐛 Bug Confirmed Bug is confirmed

Comments

@kimroen
Copy link

kimroen commented Aug 31, 2020

🐛 Bug Report

When updating to ts-jest version 26.3.0, we got the following error when trying to run tests:

TypeError: jest_util_1.globsToMatcher is not a function

      at ConfigSet.get (node_modules/ts-jest/dist/config/config-set.js:183:39)
      at ConfigSet.<anonymous> (node_modules/ts-jest/dist/util/memoize.js:52:24)
      at node_modules/ts-jest/dist/compiler/language-service.js:161:25
          at Array.map (<anonymous>)
      at Object.resolveModuleNames (node_modules/ts-jest/dist/compiler/language-service.js:158:28)
      at Object.compilerHost.resolveModuleNames (node_modules/typescript/lib/typescript.js:139254:52)
      at actualResolveModuleNamesWorker (node_modules/typescript/lib/typescript.js:100067:133)
      at resolveModuleNamesWorker (node_modules/typescript/lib/typescript.js:100285:26)
      at resolveModuleNamesReusingOldState (node_modules/typescript/lib/typescript.js:100358:24)
      at processImportedModules (node_modules/typescript/lib/typescript.js:101847:35)

As far as I can see, this is because ts-jest is depending on a version of jest-util where the lower accepted version does not have this function, so for my particular lockfile:

npm ls jest-util
...
└─┬ [email protected]
  └── [email protected]

globsToMatcher was introduced in [email protected]:

jestjs/jest@504cace

I believe specifying ^26.1 as the version for jest-util would be closer to what we actually want considering we're using this particular function.

@kimroen kimroen added Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Aug 31, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 31, 2020

yes, specifying ^26.1.0 for package.json should solve the issue, though It is strange that npm upgrade doesn't upgrade jest-utils in this case.

@kimroen
Copy link
Author

kimroen commented Aug 31, 2020

@ahnpnl Dependabot is doing this upgrade for us, so perhaps that has something to do with it.

@ahnpnl ahnpnl added 🐛 Bug Confirmed Bug is confirmed and removed Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Aug 31, 2020
ahnpnl added a commit that referenced this issue Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Confirmed Bug is confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants