-
Notifications
You must be signed in to change notification settings - Fork 250
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
Validate config using JSON schema #2123
Conversation
70e95bf
to
2fcf055
Compare
Note: Mutation testing report can be found here: |
2fcf055
to
627d2f7
Compare
I just rebased on master, please rebase and merge instead of squash merge, if you're ready. |
@simondel I've found this package and tested it out: https://github.com/atlassian/better-ajv-errors It actually works great. Although it won't filter the errors, so it would only be a replacement for Some examples: Also, it will not represent the actual code of your Stryker options are written in plain JS format rather than your JSON format. |
I think I'm falling in love with better-ajv-errors 😍 |
I've opened an issue to move all the ajv error filtering logic to better-ajv-errors, let's see what they think about it: |
* Deprecate `Config`, use `StrykerOptions` instead (no `set` method) * Deprecate `ConfigEditor`, use `OptionsEditor` instead
Use the declarative nature of JSON schema to make implementation more DRY and maintainable. * Use [ajv](https://github.com/epoberezkin/ajv) to validate StrykerOptions against the schema * Use ajv to fill in the default values
Introduce the `ConfigError`. If that is thrown, no stacktrace will be shown
Remove es5 workarounds around `Error`, so `err instanceof StrykerError` works
627d2f7
to
ea6a895
Compare
This merge request is far too big! (sorry 🙄)
A number of improvements:
Config
in favor ofStrykerOptions
Config
aninterface
now, for the time being, to be removed in next major versionStrykerOptions
JSON schema from the APIStrykerOptions
using JSON schemafilterEmpty
in favor ofnotEmpty
noopLogger
to utils (used in 3 places now)instanceof StrykerError
works.Please don't squash merge (rebase and merge is fine), so the changelog will contain all these things.