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

Unit tests fail with 'TS2307: Cannot find module 'jest-marbles' or its corresponding type declarations' in Azure DevOps pipelines #541

Open
cliffAtOsaic opened this issue Jul 25, 2024 · 1 comment

Comments

@cliffAtOsaic
Copy link

I'm aware this could be an Azure DevOps issue or some configuration issue on my part rather than a bug. Any help is appreciated.

Working on a private branch of our Node web app code with a freshly installed copy of jest-marbles 3.1.0.

Running from the command line locally works fine, effectivly:

npm ci
nx exec -- nx build --skip-nx-cache
npx nx test --coverage --coverageReporters=cobertura,lcov

Executed locally, these steps work fine and 100% test pass rate.

However, in Azure DevOps, 7 tests fail with the error:

TS2307: Cannot find module 'jest-marbles' or its corresponding type declarations

I haven't been able to find the discrepancy between the build pipeline and the local environment. Any suggestions?

@just-jeb
Copy link
Owner

Not sure how I can help here honestly.
The error seems to be coming from TS, but it complains about non-existent module. I'd try to isolate it: try to run the same pipeline with JS test (to see if the issue is the module or TS), and if it reproduces in JS then try to debug it with why yarn, print out the lock file, node_modules structure and understand why the module is not there. It might be just some Yarn/NPM hierarchy issue (especially if it's a monorepo) but maybe also something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants