-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add option to load .cjs config file #83
Conversation
Nice. Thanks for this! If you feel like it, would be good to add a integration test for this:
|
Ok I added a test |
hmm, main reason is because it's designed specifically for jest. I wonder if there could be entry points just for jest: |
@@ -0,0 +1,32 @@ | |||
module.exports = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably name this .cjs
to actually test the CJS feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
I don't really understand how the tests are being run
Eslint is yelling at me:
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: tests/configs/cjs/jest-dynalite-config.cjs.
The file must be included in at least one of the projects provided.
I couldn't find what to change to make it happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add "*.cjs" to the tsconfig.esllint.json
at the root of the repo. Atm I think it only includes .js
and .ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand how the tests are being run
If you runyarn test
you will see, they are effectively integration tests which ensure dynalite functions with an actual jest setup rather than unit.
The idea here is we want to ensure that .cjs
configs do actually work and don't regress
Pull Request Test Coverage Report for Build 2416645686Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Thanks! |
Thank you! Any chance you could do a release please? 🙏🏻 |
Apologies, pushed this as |
Thanks a lot! |
Ref: #73 (comment)
Since it's too much work to change the setup step to be async to do a dynamic import(), we can just specify our config to be CJS and not try to import ESM config in an ESM project.