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

Testing coverage #17

Open
freemvmt opened this issue Nov 8, 2019 · 1 comment
Open

Testing coverage #17

freemvmt opened this issue Nov 8, 2019 · 1 comment
Assignees

Comments

@freemvmt
Copy link

freemvmt commented Nov 8, 2019

So I also ran nyc on your code to see what would come out.

To do this I ran npm install -D nyc and then added the following line to the "scripts" section of your package.json:

"coverage": "nyc tape test.js | tap-spec"

When I then ran npm run coverage in the terminal, it runs the normal tape tests and pops this out at the end:

Screenshot from 2019-11-08 10-27-53

I would ignore the 'uncovered' line at 84 in your logic.js file - we had the same and it just refers to the fact that the (typeof module !== 'undefined') condition that is tested for before exporting the module always comes out false, which is desirable and not really part of the functionality we are trying to test (I think!). This also accounts for some of the branch % coverage.

I might attend to the uncovered line at 60 though, since it suggests an incompletely tested function (accounting as it does for some of the branch % and the rest of the function % coverage).

NB. This may be resolved without further testing by addressing the 'test done property has been changed' test, as per my comments in issue #14.

Isn't testing fun ;)

@freemvmt
Copy link
Author

freemvmt commented Nov 8, 2019

Apologies for the long notes on installing nyc btw, just wanted to be clear what I'm doing so you can definitely reproduce it if you want to 👍

@roshlarosh roshlarosh self-assigned this Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants