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

feat(esm config): support config file as pure esm #3432

Merged
merged 11 commits into from Feb 17, 2022
Merged

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Feb 15, 2022

Support your stryker.conf.js file to be a pure esm when { "type": "module" } in your package.json file.

Also add support for 2 new default configuration file names: stryker.conf.mjs and stryker.conf.cjs.

  • Implement new algorithm in the config reader
  • Add unit tests and update integration tests
  • Update the docs to include export default { }
  • Update stryker init to include auto-detect package types and choose the correct format.

BREAKING CHANGE: module.exports = function(config) {} is no longer supported in your stryker.conf.js file. This was already deprecated, but now will give an error.

Closes #3408

@nicojs nicojs enabled auto-merge (squash) February 17, 2022 16:12
@nicojs
Copy link
Member Author

nicojs commented Feb 17, 2022

@simondel I've decided that stryker init will output a stryker.conf.mjs file from Stryker 6 onward. That way we don't need to support 2 js output formats in the stryker init command.

Loading stryker.conf.mjs files is supported from nodejs 12 onward, so it should be no problem for Stryker@6

@nicojs nicojs merged commit 309a7e2 into epic/esm Feb 17, 2022
@nicojs nicojs deleted the feat/esm-config branch February 17, 2022 16:28
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

Successfully merging this pull request may close these issues.

None yet

1 participant