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

Issue with jest integration failing to resolve module #48

Open
DJSnitker opened this issue Mar 21, 2022 · 0 comments
Open

Issue with jest integration failing to resolve module #48

DJSnitker opened this issue Mar 21, 2022 · 0 comments

Comments

@DJSnitker
Copy link

Type

What kind of issue is this?

[ X ] Bug report.
[ X ] Feature request.

Description the Issue

Cannot find module 'driver-license-validator' from 'src/lib/foo.js'

Steps to Reproduce

npm install driver-license-validator --save
import { isValid } from 'driver-license-validator';
npm run test

Other Information

Jest configuration is basic with no advanced setup or custom jest configuration, just the following sonar integration in package.json

    "jest": {
        "testResultsProcessor": "jest-sonar-reporter"
    },

Other typescript project dependencies such as uuid, moment, etc seem to work out of the box no problem. But whenever running tests with this import we get the error provided in the description above :

Cannot find module 'driver-license-validator' from 'src/lib/foo.js'.

Note: This is a new addition to a legacy javascript project that's been around for some time. The library works and executes at run time, so this seems to be purely an issue with path resolution in jest - but for the life of me I can't find a difference to indicate why we can't resolve on this dependency alone during the test lifecycle. Hoping you guys might have some experience running in to this type of issue or maybe some insight on if we have misconfigured something.

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

1 participant