Thursday, 27 April 2017

How to get full coverage of a CLI nodeJS app with istanbul?

I am using this config:

I) Code coverage :

Istanbul

II) Testing framework :

Mocha

III) Assert library :

Chai

Since I want to test a scrapper, I also want to use a http testing tool, a timer testing tool and a CLI testing tool

IV) HTTP testing tool :

supertest (same as express is using)

V) Timer testing tool :

Sinon

VI) CLI testing tool :

mock-utf8-stream

My question is simple: How can I test my cli program and achieve at the same time 100% code coverage with istanbul? No matter what tool you are using, I would like to understand how you are doing it please!

I found this article which was very helpful at the beginning but

  • It was written in 2014
  • The module mock-utf8-stream does not seem standard
  • It does not explain clearly the code architecture (maybe I had too much beer I don't know)

cheers



via Amine

No comments:

Post a Comment