My package.json
contains this:
"devDependencies": {
"typescript": "~4.6.2",
"jest": "~27.5.1",
"ts-jest": "~27.1.3",
"@types/jest": "~27.4.1",
"@types/uuid": "~8.3.0"
},
I get an error like this when I run pnpm run test
:
FAIL test/types/combineModelsByPropertyNameAndType.spec.ts
● Test suite failed to run
TypeError: Jest: a transform must export a `process` function.
at ScriptTransformer._getTransformer (../../node_modules/.pnpm/@jest+transform@26.6.2/node_modules/@jest/transform/build/ScriptTransformer.js:360:13)
at ScriptTransformer.transformSource (../../node_modules/.pnpm/@jest+transform@26.6.2/node_modules/@jest/transform/build/ScriptTransformer.js:427:28)
at ScriptTransformer._transformAndBuildScript (../../node_modules/.pnpm/@jest+transform@26.6.2/node_modules/@jest/transform/build/ScriptTransformer.js:569:40)
at ScriptTransformer.transform (../../node_modules/.pnpm/@jest+transform@26.6.2/node_modules/@jest/transform/build/ScriptTransformer.js:607:25)
So despite stating in devDependencies
that jest
27 should be used, its using version 26 in actuality - which is the cause of that error from jest.
For context: I am using turborepo
as my monorepo management tool, and other modules in my monorepo do use jest 26. So I am not sure if this is a pnpm question or a turborepo question