Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Merge Config and StrykerOptions #17

Open
nicojs opened this issue Feb 24, 2017 · 0 comments
Open

Merge Config and StrykerOptions #17

nicojs opened this issue Feb 24, 2017 · 0 comments

Comments

@nicojs
Copy link
Member

nicojs commented Feb 24, 2017

We should be able to merge the Config class and StrykerOptions classes.

They are both quite similar. StrykerOptions has basically the same interface as Config, but optional. We can use awesome ts2.1 mapped type Partial<Config> for this:

https://github.com/Microsoft/TypeScript/blob/0a535f0bf7193741e6b4acf5b7dfea88e2d4beca/lib/lib.d.ts#L1379-L1384

One problem is the set function. I actually don't like it. Could we get rid of this? Why do we need it? We could make our config simpler:

module.exports = {
    // Stryker config
}

... so no function(config){ config.set({ ... })} anymore.

I propose to do this in 2 phases.

  1. Make the set method deprecated. Support both versions of config.
  2. Remove it in a future version.

@simondel what do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant