Skip to content
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

Error thrown when I use --coverage-exclude #557

JCarran0 opened this issue Apr 5, 2016 · 2 comments


Copy link

@JCarran0 JCarran0 commented Apr 5, 2016

lab -c --coverage-exclude demos is throwing the following error:

    global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js', 9, 8, true); ((global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',1,8,typeof exports === 'object')&&global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',2,8,typeof module !== 'undefined'))? global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',7,8,module.exports = factory()) : global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',8,8,((global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',3,9,typeof define === 'function')&&global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',4,9,define.amd))? global.__$$labCov._statement('/Users/jcarrano/nv-student-api/node_modules/moment/moment.js',5,9,define(factory)) : global.__$$labCo

TypeError: Cannot read property '_statement' of undefined

Where demos is a top level directory in my project. I've tried to exclude other folders with the same issue.

npm v3.3.12
node v5.3.0
moment ~2.12.0

@geek geek added question feature and removed question labels Apr 5, 2016

This comment has been minimized.

Copy link

@geek geek commented Apr 5, 2016

When --coverage-exclude is passed in, it overwrites the defaults that we have: ['test', 'node_modules']

This is forcing the node_modules to not be excluded any longer. I do think we should change this to merge in node_modules and to never allow that to be covered.

Back to your issue, if you run lab with the following, you should resolve the issue:

lab -c --coverage-exclude demos --coverage-exclude node_modules --coverage-exclude test


This comment has been minimized.

Copy link

@JCarran0 JCarran0 commented Apr 6, 2016

Great, that solved it. Agree that node_modules should never be tested. Thanks!

@geek geek self-assigned this May 4, 2016
@geek geek added this to the 10.4.0 milestone May 4, 2016
@geek geek closed this in #574 May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.