Closed silkentrance closed 9 years ago
Are you wanting the whole runtime included in your instrumented code? I'm not sure I see a use case there, as you'll be including a bunch of code that might not get covered.
--use-babel-runtime
passes a flag to babel tells the compiler to use the babel-runtime instead of generating verbose code every time. The instrumented code should never include the actual runtime, but it will reference helper functions from babel-runtime instead.
No, of course not, it should still be optional. It seems though, as if the option is not being evaluated at all:
This is the this.opts from the instrumenter:
{"coverageVariable":"__coverage__","embedSource":false,"noCompact":false,"preserveComments":false}
As you can see, the instrument command will not properly configure the options from the command line...
Ah, I set up the commands for run-with-cover specifically. You are using the instrument command. I can update the instrument command to utilize the applicable arguments.
Okay, I see. This would be great since it actually makes more sense to have the instrumented code use the runtime, too!
And that way, the boilerplate code would not be analysed for coverage...
TIA!
Please do not forget to also change the following lines in lib/instrumenter.js
444 if (this.opts.useBabelRuntime) {
445 babelConfig.optional = ['runtime'];
446 }
According to the spec, babel expects this to be an array, dunno if it will work with just a string.
Just published 0.2.5, it should be updated. Thanks!
Great, thanks.
I am trying to instrument a source that uses generators and iterators.Invoking
will produce instrumented code that does not include the required runtime.
Which might be due to the fact that
and you simply pass in
lines 444ff@lib/instrumenter.js
Yet, when patching the code so that it will pass in an array, it will still not work. Might this be related to the fact, that the babel specific options are never actually processed in lib/command/instrument.js?