Istanbul: How to ignore code coverage of the .catch in promise?

Created on 18 Sep 2017  路  3Comments  路  Source: gotwarlost/istanbul

I'm using bluebirdjs library for my promise implementation but I can't find a way to ignore the .catch((err) => err) with the code coverage. Is this possible?

Most helpful comment

I have the same problem. I use the following code and it works.

.catch(/* istanbul ignore next */ err => next(err));

All 3 comments

I have the same question. Is there a way to not take those into account in the coverage?

I think you want to take this into account, why wouldn't you? bad code in those catch blocks will take down your app unless you test those paths too.

I have the same problem. I use the following code and it works.

.catch(/* istanbul ignore next */ err => next(err));
Was this page helpful?
0 / 5 - 0 ratings

Related issues

gbahamondezc picture gbahamondezc  路  24Comments

briancullinan picture briancullinan  路  22Comments

graemej picture graemej  路  22Comments

dankohn picture dankohn  路  25Comments

lizhexia picture lizhexia  路  60Comments