The problem here is that, without using t.plan, these tests would pass even if the error wasn't thrown. And most tests using this pattern are not calling t.plan. My suggestion is to replace these try/catch occurrences with t.rejects, making the tests simpler and preventing these false positives.
Several unit tests that check if a given error has been thrown are using the following approach:
The problem here is that, without using
t.plan
, these tests would pass even if the error wasn't thrown. And most tests using this pattern are not callingt.plan
. My suggestion is to replace these try/catch occurrences witht.rejects
, making the tests simpler and preventing these false positives.FYI: @simoneb