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

New to test coverage and confused about how NYC determines what code is covered #1341

Closed
3 tasks done
tylers-username opened this issue Aug 18, 2020 · 2 comments
Closed
3 tasks done
Labels

Comments

@tylers-username
Copy link

tylers-username commented Aug 18, 2020

Link to bug demonstration repository

https://github.com/tylerssn/debug-nyc

Expected Behavior

I expect to know when code will be covered;

I expect my InvalidIndexError class to be 100% covered by currently implemented tests.

Observed Behavior

Lines 5-6 of `InvalidIndexError.ts` is not covered by my test.

ERROR: Coverage for lines (26.56%) does not meet global threshold (90%)
----------------------|---------|----------|---------|---------|-------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------------------|---------|----------|---------|---------|-------------------
All files             |   24.64 |    35.29 |    37.5 |   26.56 |                   
 Index.ts             |       0 |        0 |       0 |       0 | 1-82              
 InvalidIndexError.ts |   80.95 |    46.15 |      75 |   89.47 | 5-6               
----------------------|---------|----------|---------|---------|-------------------

Troubleshooting steps

  • still occurring when I put cache: false in my nyc config
  • removed all other project files unrelated to the test
  • reviewed documentation

Environment Information

npx: installed 1 in 1.61s

  System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 1.59 GB / 16.00 GB
  Binaries:
    Node: 14.6.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.7 - /usr/local/bin/npm
  npmPackages:
    nyc: ^15.1.0 => 15.1.0 
    source-map-support: ^0.5.19 => 0.5.19 
    ts-node: ^8.10.2 => 8.10.2 
    typescript: ^3.9.7 => 3.9.7 

@tylers-username
Copy link
Author

Updated issue with link to repository.

@stale
Copy link

stale bot commented Sep 6, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant