Stryker: Add support for mutating Javascript vNext

Created on 20 Oct 2017  路  8Comments  路  Source: stryker-mutator/stryker

We should add support for mutating JavaScript vNext (6, 7, etc).

This issue tracks the work done on branch stryker-es6-mutator

Todo:

  • [x] Rewrite current es5 mutators using babel
  • [x] Remove IdentitifiedNode
  • [x] Rename to stryker-javascript-mutator
  • [x] Add unit tests for mutators
  • [x] Add deprecation warning when using the es5 mutator.

This issue is closely related to #133

Most helpful comment

Not open source sorry, anyway it's just a create-react-app 馃憤

All 8 comments

@nicojs What do you think of this message?
image

Just to make sure I understand what is changing....

ES5 will still be supported, just through this new module. Is this correct or are you saying you are dropping support for mutating ES5 code once this is released?

@j-truax that is correct. Since Stryker is now language agnostic we've chosen to move out the code for mutating JavaScript. This new implementation is based on babel, which can be a pretty large dependency, especially if you don't need it (for example, when mutating typescript code). So Stryker itself won't be mutating code anymore (which is a little bit ironic for a mutation testing framework). We will give people some heads-up time with this deprecation warning.

What do you think of this message?
message

How about: DEPRECATED: The es5 mutator is deprecated and will be removed in the future. Please upgrade to the stryker-javascript-mutator (npm install --save-dev stryker-javascript-mutator) and set "mutator: 'javascript'" in your stryker.conf.js!

@nicojs Thanks for the clarification. Glad we are not losing ES5 support :+1:

And yes that is ironic :smile: for a mutation framework.

Either message seems sufficient to me

I've changed the message to your suggestion @nicojs 馃憤

Is this going to support any babel plugin? (JSX, Flow, stage-2 etc?)

@FezVrasta Not in the initial version but we plan on adding it later on. If you look at this line we don't specify any options object. In the future we could pass an options object with a plugins sections. This however won't fix everything as the stryker plugin may not know how to mutate the code.

Note that this plugin is merely for mutating the code. If the input was ES2017 code, the output will be ES2017. In order to run ES2017 code in your environment you may have to transpile it to ES5. That will be handled by a plugin like _stryker-babel-transpiler_ which we plan on developing in the future.

Is your code open source? If not, a demo project would help us test the plugins early on 馃憤

Not open source sorry, anyway it's just a create-react-app 馃憤

Was this page helpful?
0 / 5 - 0 ratings