We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I upgrade @pacote/jest-either from 4.0.9 to 5.0.0, got error when running test:
@pacote/jest-either
4.0.9
5.0.0
Test suite failed to run Cannot find module '@pacote/jest-either' from ...
import matchers from '@pacote/jest-either'; expect.extend(matchers); ... expect(something).toBeLeft();
I tried some solutions searched from StackOverflow, didn't solve the problem, can anyone help with it?
Tried: modify modulePaths or moduleDirectories, didn't work...
modulePaths
moduleDirectories
The text was updated successfully, but these errors were encountered:
There seems to be an issue with the package, but for ESM support in Jest this is what I've been able to piece together:
npm install --save-dev jest@next ts-jest@next
ts-jest
NODE_OPTIONS=--experimental-vm-modules
@pacote/jest-either/lib
package.json
{ "scripts": { "test": "NODE_OPTIONS=--experimental-vm-modules jest" }, "jest": { "preset": "ts-jest/presets/default-esm", "globals": { "ts-jest": { "useESM": true } }, "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" } }, "devDependencies": { "@pacote/jest-either": "^5.0.0", "fp-ts": "^2.11.5", "jest": "^27.0.0-next.11", "ts-jest": "^27.0.0-next.12", "typescript": "^4.5.4" } }
test.ts
import { right } from 'fp-ts/Either' import matchers from '@pacote/jest-either/lib' expect.extend(matchers) test("sanity", () => { expect(right('ok')).toEqualRight('ok') })
tsconfig.json
{ "compilerOptions": { "moduleResolution": "node" } }
Hope this helps.
Sorry, something went wrong.
No branches or pull requests
What
When I upgrade
@pacote/jest-either
from4.0.9
to5.0.0
, got error when running test:ENV
Code
I tried some solutions searched from StackOverflow, didn't solve the problem, can anyone help with it?
Tried: modify
modulePaths
ormoduleDirectories
, didn't work...The text was updated successfully, but these errors were encountered: