floatdrop/pinkie

Improve coverage

floatdrop opened this issue · 14 comments

100% coverage would be nice to have.

So far I managed to get 96.24% coverage, can't progress any further. Either I'm missing some special test cases, or the code has redundancies in it.

@vitaly-t I don't think this code has redundancies. I've added some tests and leave one line uncovered, in case you want to practice ;)

@floatdrop thanks for the update, but for all the tests that you just added, I already had all of them included in my tests. None of them cover the remaining 3.76% of code.

invalid construction:

exception during construction:

The other ones are trivial, not so much edge cases, and I had them from the beginning.

By the way, since you are improving styling and syntax: // then should be retrived only once - word retrieved is misspelled.

@vitaly-t I still don't get this yours/mine repository thing, but whatever.

None of them cover the remaining 3.76% of code.

Report now says 99%, so obviously some code got covered.

word retrieved is misspelled

Thanks, fixed.

I provided links for your test implementations + mine for the same tests.

99% - which test is saying that? Mine says 96.24%, and I have all of the tests you added.

Since your tests don't work on Windows and they don't work on OS X either, I have to ask you if you would please run my tests, which work on any OS: testing

That gives a very detailed report of which lines are not executed.

Since your tests don't work on Windows and they don't work on OS X either

Travis builds are working fine - so tests under OS X and Unix systems are working.

Well, I have the latest OS X El Capitan here, and I'm seeing the same error as on Windows when trying to run the tests.

Here's a screenshot, if you don't believe me...

error

@vitaly-t sorry, didn't notice it earlier - you are launching tests from node_modules - probably because you don't clone repository, but run npm install pinkie. In this case npm will not download whole repository (with test.js file). Please run git clone https://github.com/floatdrop/pinkie.git && npm install && npm test.

Ok, I was able to run the tests on OS X now, not on Windows, due to issues in line breaks.

I can see the 99% result the test produces, but I couldn't find any detail about it, like the ones I'm getting when running my tests, so I don't know what to make of it, or how to trust the results.

If you run my tests, you are getting a comprehensive report with each line coverage + each execution path. But there I can't really see anything.

Can we try it the other way round - run my tests, see the lines being missed, and tell me which test you think should cover the lines that are missed? This way we can try to match your results with mine.

I can see the 99% result the test produces, but I couldn't find any detail about it

@vitaly-t I guess you can add --reporter html to nyc command to see detailed coverage report, but default output contains uncovered lines already:

screen shot 2015-11-10 at 22 56 37

So the uncovered line is 94.

I saw it, but it doesn't help me understand what tests am I missing, only you can tell me that by looking at my test coverage. As far as I can tell, all the tests that you are executing, so am I, but the coverage results are different.

@vitaly-t you can figure this out by running test.js on your library. I'm 100% sure, that you are missing some tests from this commit.

We are using different test engines, I cannot execute your tests, and I've tried.

And I have every single test from your last commit. If you think otherwise - please tell me which test you think I do not have.

You wrote the library, you wrote your tests. Why can't you just look at the lines I'm missing in my coverage and tell me which test is supposed to cover them? This is the simplest thing to do, and in fact the same thing I've been asking from the very beginning. There are like 4 lines missing only.

UPDATE: To make it even simpler: Which test is expected to cover lines 110 - 115?

Why can't you just look at the lines I'm missing in my coverage and tell me which test is supposed to cover them?

Because I don't write your library, neither your tests. I believe than you can do it by yourself, you just need some patience and (probably) use debugger, like WebStorm. Have fun! :)