jimivdw / grunt-mutation-testing

JavaScript Mutation Testing as grunt plugin. Tests your tests by mutating the code.
MIT License
51 stars 11 forks source link

is es6 supported? #65

Closed travi closed 8 years ago

travi commented 8 years ago

i'm trying to test out this project on an es6 project, but am getting the following error for each file:

(00:15:52.332) WARN [mutation-testing]: Tests fail without mutations for file: /var/folders/9l/q9klhdys15xcxrqxpmh76ccr0000gn/T/mutation-testing11659-56658-9msma5/src/index.js
(00:15:52.333) WARN [mutation-testing]: This failure may be due to a misconfiguration of either `code` or `specs`. Did you include your external libraries?

my test/mocha.opts file is configured to apply babel when running the tests, which works properly in all of the other ways that i run my tests. when defining the testFramework is set to mocha does it preserve the default mocha behavior of using the mocha.opts file under test/? even if so does the code need to be transpiled before the mutations can be applied?

also, is there some way to see the output of the failure that is happening? i'm sure that would be very informative related to understanding what needs to change. even with the logLevel set to ALL, i see none of the output from the underlying failure.

if it would be helpful, the project i'm currently trying to test this out on is https://github.com/travi/admin.travi.org-components

jimivdw commented 8 years ago

Short answer: no, ES6 is not supported as of now...

... but we would really like to add support for it soon. The biggest problem we currently have is that the EStree AST serializer we use (escodegen) has still not got ES6 support. I think we need to move to another serializer because of that, but that is of course a bit more work. In the meantime, I'm afraid you can only use grunt-mutation-testing on your transpiled code.

As for your question about the logging, I think that you need to not only set the logLevel of grunt-mutation-testing to ALL, but also mocha's log level. I unfortunately don't have a lot of experience with mocha, nor the mocha part of this tool (was already there when I took over the project). I'm hoping you can figure it out yourself, but please let me know if you need any more help.

-- Jimi

travi commented 8 years ago

thank you for the response. that totally makes sense, but i appreciate the clarification. i'm very interested in mutation testing, especially in javascript, but i don't think i have the bandwidth to help you move the project forward unfortunately. i will keep an eye on it and look forward to seeing what might be possible in the future.