hoodiehq / pouchdb-admins

PouchDB plugin to simulate CouchDB’s admin accounts
Apache License 2.0
7 stars 2 forks source link

Bring code coverage to 100% #11

Open gr2m opened 8 years ago

gr2m commented 8 years ago

To get coverage run npm run test:coverage. The result will look something like this:

=============================== Coverage summary ===============================
Statements   : 94.51% ( 86/91 ), 1 ignored
Branches     : 72.73% ( 16/22 ), 2 ignored
Functions    : 100% ( 19/19 )
Lines        : 94.51% ( 86/91 )
================================================================================

Now open coverage/lcov-report/index.html in your browser and see what lines and branches are not covered, and add tests until hey all are :)

kazekagegaara commented 8 years ago

Any references for this? Looks like tests have to be written for if conditions, but I'm not sure how to write such tests. I can take try to do this.

gr2m commented 8 years ago

here are pull requests that increased coverage:

Let me know if you have any questions :)

kazekagegaara commented 8 years ago

Had a look at these PRs, also read about Tape. I guess I'll need some more time to understand the code and write the tests. :(

gr2m commented 8 years ago

@kazekagegaara I’m packed this week, but if you like we can pair on it for a bit next week, to help you get going? Tuesday is looking good for me, after 10am Boston time

kazekagegaara commented 8 years ago

@gr2m sounds good. Will let you know my time frame. Thank you!

gr2m commented 8 years ago

@kazekagegaara are you still up for this? If not I’d make it available for someone else to look into it

kazekagegaara commented 8 years ago

@gr2m I haven't had the time to look into this, and won't have the time for the next couple of weeks. Someone else can have a look into this if it's urgent. If you can wait till the first week of June, then I might be able to do it. Your call.

gr2m commented 8 years ago

@kazekagegaara it’s first week of June :) How are things looking?

kazekagegaara commented 8 years ago

@gr2m yea, I've been trying around to play with things since a couple of days. Somehow I can't figure out tape testing error scenarios. Would you be able to guide a little with it? Just 15 minutes maybe?

gr2m commented 8 years ago

Sure, can you join our http://hood.ie/chat/ and ping me there? I’m @gregor

gr2m commented 8 years ago

you need to run this command

npm run test:coverage

That will create the ./coverage folder. Open ./coverage/lcov-report/index.html in a browser, it will look like this:

coverage

The goal is to get all the numbers to 100%, statements, branches and lines. You need to add tests until all lines and all if/else branches are being run by them. Makes sense?