-
Notifications
You must be signed in to change notification settings - Fork 176
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
/*
$lab:coverage:(off|on)$ */
disables coverage for a whole module
#459
Comments
Can we see the transpiled code ? |
Sure here's the html reporter output: http://eriktrom.s3.amazonaws.com/coverage.html Let me know if you'd like to see anything else, like a fresh git init of the source code for public consumption. |
Also, here's the html coverage output with the coverage off/on blocks in use(for comparison): http://eriktrom.s3.amazonaws.com/coverage-with-on-off-comments.html |
Would help to have the full code to debug on our side yes. |
Np - I'll make a repo by the morning - went a little buck wild with log stash one day. Have no idea what keys went into git. Will wipe and share. Thanks BTW. Really dig ur guys frameworks. |
@Marsup - https://github.com/eriktrom/xyz I've committed the EDIT: In this commit eriktrom/xyz@7fb0932 I show the issue at hand(in lib, dist and coverage.html) |
are there any updates for that issue? |
Sorry, forgot that one. Transpilation seems to remove comments, of course that won't work. Never had any issue with pure node so my guess is the problem will always be in your build tools. |
I think I found out why this may be happening. Checkout PR #620 for more details. |
@jedireza - from a different project, but exact same setup:
For reference, the top of the file looks like: /* $lab:coverage:off$ */
import Model from './';
import _ from 'lodash';
import Promise from 'bluebird';
/* $lab:coverage:on$ */
export default class Listing extends Model {
constructor() {
super(...arguments);
}
// ...snip Note that this output is the same with and without the If there is good reason too, I can test the old project linked above, but I'm pretty sure everything related to this issue is the same. (except the new version of lab of course) Thanks a bunch @jedireza and everyone who put some time into debugging this. Let me know if there's anything more I can do that would help. EDIT: Maybe worth noting that /* $lab:coverage:off$ */;import Model from './';
import _ from 'lodash';
import Promise from 'bluebird';
/* $lab:coverage:on$ */ will output this, which is perhaps closer(and maybe??) similar to your pr code - note lab on/off are both shown here, but start below the import statements, and either way the |
@eriktrom I'm using Try updating your transform to something like: let result = Babel.transform(content, {
sourceMap: 'inline',
filename: filename,
sourceFileName: filename,
auxiliaryCommentBefore: '$lab:coverage:off$', // the magic sauce
auxiliaryCommentAfter: '$lab:coverage:on$' // ;)
}); Using the auxiliary comment options, I tried the same thing you described above locally and it seems to be working as expected.
|
@jedireza - that is some very sweet magic sauce - works even without the coverage on/off comments now for me - just straight es6 - your the man, thanks for all the work - i saw your project a while back and was hoping u figure it out :) Sweet! |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Howdy folks - when using the following:
I get 100% coverage for the entire module(in both console and html output). When I remove the
$lab:coverage:(off|on)$
comments, I get what I expect.This seems to indicate that
/* $lab:coverage:on$ */
does not turn coverage back on for the remaining lines.(Ancillary note:
import Blah from 'blah'
causes the babel compiled output to fail coverage for the ternary statement it does for imports , that's a separate issue(but it does exist, fyi). Putting off/on comments around the imports seemed like a way forward for now, but then I hit this wall.)I am using the following tools/versions:
node/v4.1.1
babel/5.8.23 (babel-core 5.8.25)
lab/6.1.0
Note: issue also occurred on lab 5.x.x, I just upgraded to 6.x before making this issue(w/ same result)
Note: I have not tried on older versions of node
My babel transform function (is mostly copied from the README with some slight alterations):
The lab cli command I run is:
Word of warning: Babel and Lab are both new toolz I am playing with, forgive me if there is user fault involved, although I tried to make sure this was actually an issue before submitting one.
Let me know if more information is needed. Tell me where to look and I'll help fix it :)
Thanks and cheers!
The text was updated successfully, but these errors were encountered: