Skip to content

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

@kimroen

Description

@kimroen

🐛 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
...
└─┬ ts-jest@26.3.0
  └── jest-util@26.0.1

globsToMatcher was introduced in jest-util@26.1.0:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions