Since this happened when running a pretty large test suite, I was not immediately sure what had happened, nor which test case had actually failed. After some debugging it turned out that I had called expect(foo).toContain(bar), where foo was null. This pull request provides a better error message in this case:
Failures:
1) toContain should print helpful error message when matching null
Message:
Expected null to contain 'needle'.
Stacktrace:
Error: Expected null to contain 'needle'.
at null.<anonymous> (.../minijasminenode/spec/tocontain_spec.js:3:18)
I am not sure this is the correct repo to fix this in.
I also did not find any unit tests for the matchers, so I was not sure if I should add one for this change.
Please advice.
I was recently thrown off by the error message
Since this happened when running a pretty large test suite, I was not immediately sure what had happened, nor which test case had actually failed. After some debugging it turned out that I had called expect(foo).toContain(bar), where foo was null. This pull request provides a better error message in this case:
I am not sure this is the correct repo to fix this in. I also did not find any unit tests for the matchers, so I was not sure if I should add one for this change. Please advice.