Skip to content

Commit e7e7a3b

Browse files
committed
Add Test Coverage Stats With Jest as a javascript til
1 parent 5dc7c38 commit e7e7a3b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For a steady stream of TILs from a variety of rocketeers, checkout
1111
[til.hashrocket.com](https://til.hashrocket.com/).
1212

13-
_652 TILs and counting..._
13+
_653 TILs and counting..._
1414

1515
---
1616

@@ -255,6 +255,7 @@ _652 TILs and counting..._
255255
- [Splat Arguments To A Function](javascript/splat-arguments-to-a-function.md)
256256
- [Spread The Rest With ES6](javascript/spread-the-rest-with-es6.md)
257257
- [String Interpolation With Template Literals](javascript/string-interpolation-with-template-literals.md)
258+
- [Test Coverage Stats With Jest](javascript/test-coverage-stats-with-jest.md)
258259
- [Throttling A Function Call](javascript/throttling-a-function-call.md)
259260
- [Timing Processes](javascript/timing-processes.md)
260261
- [Transforming ES6 and JSX With Babel 6](javascript/transforming-es6-and-jsx-with-babel-6.md)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Test Coverage Stats With Jest
2+
3+
Jest is a delightful tool for JavaScript testing from Facebook. As your
4+
project evolves and you add tests (or perhaps choose to not add tests) you
5+
may wonder what kind of test coverage you have. What is the overall
6+
coverage? Which files are well covered and which are seriously lacking?
7+
8+
Use the `--coverage` flag to get this information.
9+
10+
```bash
11+
$ jest --coverage
12+
```
13+
14+
After running all of your tests a table will be output to the terminal with
15+
a list of files and their respective coverage percentages in terms of
16+
statement, branch, function, and line coverage.
17+
18+
```
19+
---------------------------|----------|----------|----------|----------|----------------|
20+
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
21+
---------------------------|----------|----------|----------|----------|----------------|
22+
```
23+
24+
This can help guide you to what parts of your app may need more testing.

0 commit comments

Comments
 (0)