fac18 / week2-CEFG-To-do

Create a to-do app
https://fac18.github.io/week2-CEFG-To-do/
0 stars 1 forks source link

Testing coverage #17

Open freemvmt opened 4 years ago

freemvmt commented 4 years ago

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 commented 4 years ago

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 :+1: