[Edgemicro] - Code coverage for functional tests

Hello guys,

I'm trying to figure it out a way to get coverage for functional tests in custom plugins. So I was trying to add Istanbul to the edgemicro start, so I can somehow get the coverage, I wasn't able to put this in place, so after researching I came up with the istanbul-middleware project (https://github.com/gotwarlost/istanbul-middleware), which does what i need (they have a sample test application with Express there). First its possible to pass a flag to enable the coverage, internally its like a listener that keeps monitoring the code. Also they provide an endpoint (/coverage) that basically does the inspection to get the code coverage. When I start to use the app (it could be functional tests in here) and then call the /coverage endpoint, its possible to get the correct coverage for the application.

The thing is, to put this in place to work is necessary to make changes in the application, in this case I would have to change edgemicro implementation to accept this (I will run some tests to see if I really need to change the application).

So my question is, Does anyone have a strategy to have code coverage for custom plugins in edgemicro?

Thanks

Regards

Ciro

1 2 269
2 REPLIES 2

Not applicable

Cool! I've used Istambul in the past for this type of requirement and other colleagues have written articles about it, it was done in plain vanilla Node.js and Express. That being said, in Edge Micro, it might be different. @Srinandan Sridhar or @Mitchell Fierro might have some hints for you.


Thanks @Diego Zuluaga!!

Hi @Mitchell Fierro and @Srinandan Sridhardo you have any thoughts on this?

Thanks again!

Ciro