Comments (13)
Created a textreport
branch on which this change is committed. @davglass I'm looking for your feedback on command line interface and report behavior. Please check out this branch, try it out and let me know.
cover
and test
commands have the following new option:
--console <type>
type of report to print to console, one of summary (default),
detail, both or none
summary
produces something like this:
=============================== Coverage summary ===============================
Statements : 71.43% ( 10/14 )
Branches : 66.67% ( 4/6 )
Functions : 60% ( 3/5 )
Lines : 71.43% ( 10/14 )
================================================================================
detail
produces something like this
--------------------------+-----------+-----------+-----------+-----------+
File | % Stmts |% Branches | % Funcs | % Lines |
--------------------------+-----------+-----------+-----------+-----------+
lib/ | 66.67 | 50 | 50 | 66.67 |
bar.js | 40 | 0 | 0 | 40 |
foo.js | 100 | 100 | 100 | 100 |
lib/util/ | 100 | 100 | 100 | 100 |
generate-names.js | 100 | 100 | 100 | 100 |
vendor/ | 66.67 | 100 | 50 | 66.67 |
dummy_vendor_lib.js | 66.67 | 100 | 50 | 66.67 |
--------------------------+-----------+-----------+-----------+-----------+
All files | 71.43 | 66.67 | 60 | 71.43 |
--------------------------+-----------+-----------+-----------+-----------+
from istanbul.
- OK - option is called
--print summary|detail|none|both
- Available in v0.1.7
- travis build for istanbul now shows self-coverage: https://travis-ci.org/#!/gotwarlost/istanbul/jobs/2820296/L2301
- API available on node using the
Report
mechanism
Calling done. @davglass I'm going to nuke the textreport branch once you confirm you are not using it in any way. Note that the branch also has the backwards-incompatible --print
change.
from istanbul.
How about we split this into two tickets, one for the small text output and another to enforce coverage. The latter needs some thought on interface whereas the former is more of typing work.
Also, Istanbul refrains from explicitly exiting from the process since stdout/ stderr may not fully flush etc. if it gets into this business and could interfere with other exit handlers that the app under test could have set up. So some thinking on that is required before we do the process.exit(1)
thing.
I will create a new issue for the exit(1)
thing
from istanbul.
I love this:
https://travis-ci.org/#!/yui/node-cssmin/jobs/2797430
My "only" recommendation is to not use full system paths when printing, use relative to this directory.
These can get pretty long if the directory tree (think a hudson workspace) is deeply nested.
from istanbul.
That full filesystem path appears when you have a single file under test. When there are multiple files the common prefix is stripped. I need to add handling so that the entire directory path is nuked when a single file is involved.
I will fix this as a separate issue.
from istanbul.
Thanks, other than that I love it. I've already put this branch into several of my CLI tools so I can see a coverage report via Travis :)
from istanbul.
The only thing that is stopping me from merging this branch is the name of the --console
option. Could you suggest an alternative? Maybe --print
?
from istanbul.
I'm fine with --print
from istanbul.
Can you make this a method that I can use when istanbul
is required? This way my CLI tools that gather coverage can print the exact same report.
from istanbul.
On the browser? It's already available for node using the Report
mechanism. (i.e. istanbul.Report.create('text-summary')
etc.)
Browser is a harder problem since the report infrastructure is not set up to run on a browser.
from istanbul.
Nice, that's what I needed..
from istanbul.
All of my modules have been switched over to the lastest istanbul
on npm, so you can nuke the branch all you want.
FYI, I ❤️ this report:
https://travis-ci.org/yui/shifter/jobs/2847225
from istanbul.
Nice!
BTW, v0.1.8 also has the absolute path fix where it won't print the full directory name if there is only one file being covered. You should already have it if you are using the latest.
from istanbul.
Related Issues (20)
- Looking for Constantinople.js HOT 1
- is it possible to apply the effect from /* istanbul ignore next */ to all typescript private methods automagically?
- option to disable coverage on import lines
- Open Coverage File Automatically on Test Command? HOT 2
- Branches that don't exist get reported as missing
- how to use istanbul as a library
- Analyzing coverage of node server in Windows HOT 1
- exclude imported node modules from coverage reporting HOT 1
- Cannot get the backend coverage by running Cypress UI e2e test HOT 1
- Ignore implied "else"
- Coverage format documentation not explicitly stating 'end' meaning HOT 1
- Istanbul doesn't ignore nested if, when not executed
- Async package is vulnerable
- Coverage not being collected from file called "payload.ts"
- Fails when running `istanbul report` HOT 1
- Unit test branch for SignInPage showing the SignUpComponent
- Ignore docs could be clarified by adding a list of allowed keywords
- Code comments are being covered.
- Feature Request - Parcel plugin
- No function coverage for named exports in barrel file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from istanbul.