-
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
feat(config-editors): Remove side effects from all config editor plugins #1317
Conversation
* Created `Injector` class, a readonly class that can instantiate `Injectable`s * Updated the `PluginLoader`, so it can load plugins with the new way of working as well as provide a Bridge plugin for all "old fashion" plugin * Started implenenting the `BroadcastReporter` and other Reporters in the new way. Couldn't help to make some quality of life improvements: * `StrykerOptions` now have the expected required/not required properties. * Created "test-helpers" package so we can share test helpers between packages.
The TestInjector is a new way of creating your System Under Test (sut) objects. You can configure what to inject and then call `TestInjector.inject(SutClass)`
Also added some unit tests for the Injector class.
* Made the context of the Injector generic. * Made injector readonly and type safe * Moved all injector related stuff to its own package: 'typed-inject' * Updated TestInjector class to now use the new typed-inject * Updated Stryker to now use the new typed-inject * Updated Stryker-api to now use types from typed-inject
…d move implementation of functions to stryker-util
…t it in its own PR
Move all stryker plugin stuff back to the api. Talked about it with Simon. We'll allow small pieces of implentation code in the api, as long as it doesn't have any side effects
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 got one remark, could you take a look at it? I think we should make one piece of Stryker.ts
clearer
.provideValue(commonTokens.pluginResolver, pluginLoader as PluginResolver); | ||
configEditorInjector | ||
.provideFactory(coreTokens.pluginCreatorConfigEditor, PluginCreator.createFactory(PluginKind.ConfigEditor)) | ||
.injectClass(ConfigEditorApplier).edit(this.config); |
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.
The way the config editor is used here is quite sneaky. I would prefer if this is done in a separate method so we can name this operation like we had previously.
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 agree. I've changed it in the transpiler branch.
If we merge it here, I'll fix it with that one. I'm planning on working on Stryker full time from tomorrow for about 2 weeks, so if you agree I'll merge them in quick succession.
As explained, i will fix it in a later PR
Note: #1313 Needs to be merged first
Removes side effects from registering all
ConfigEditor
plugins:JestConfigEditor
MochaRunnerConfigEditor
TypeScriptConfigEditor