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

Jest not using the same configuration as build/run #323

Open
confusingbits opened this issue Aug 17, 2022 · 2 comments
Open

Jest not using the same configuration as build/run #323

confusingbits opened this issue Aug 17, 2022 · 2 comments

Comments

@confusingbits
Copy link

I'm getting strange error with a monorepo setup.

Folder structure follows sls recommendations.

package.json
lib
  lib1.mjs
services
  service1
    package.json
    index.js
    index.text.js
  service2
    package.json
    index.js
    index.text.js

I can package and run offline just fine. But when I run my tests. I get syntax errors about modules.

Screen Shot 2022-08-17 at 9 39 16 AM

Clearly this is incorrect. I've tried using import or require syntax. Changing extensions to mjs or setting "type": "module" in the project or service package.json. (Jest no longers finds the test if the extension is .mjs.)

@confusingbits confusingbits changed the title Jest not using the same configuration as build Jest not using the same configuration as build/run Aug 17, 2022
@vinhjs
Copy link

vinhjs commented Dec 27, 2023

@confusingbits
same here, Did you resolve that?

@confusingbits
Copy link
Author

@confusingbits

same here, Did you resolve that?

I did. I don't really recall a firm solution. It was some combination of code import changes, file extension changes and package module config. And I think node version?

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