Skip to content

Out of the box test coverage is not 100% #1386

@TheRobBrennan

Description

@TheRobBrennan

I love this as a starting point for React apps, but I am puzzled by one thing...Having Jest and test coverage built in is awesome, but why isn't coverage 100% out of the box?

If I run the test coverage report, I see:

[Thu Jan 12 11:29:25] fb $ npm test -- --coverage

> fb@0.1.0 test /Users/rob/repos/fb
> react-scripts test --env=jsdom "--coverage"

 PASS  src/App.test.js
  ✓ renders without crashing (18ms)

----------|----------|----------|----------|----------|----------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files |       50 |      100 |      100 |       50 |                |
 App.js   |      100 |      100 |      100 |      100 |                |
 index.js |        0 |      100 |      100 |        0 |              1 |
----------|----------|----------|----------|----------|----------------|
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.137s
Ran all test suites.

It'd be great to start folks off with 100% tested code - no matter how trivial the index.js file is =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions