juliemr/minijasminenode — pull request #28 by rehmsen (2014-12-30 13:03:51+00:00)
Title: Better error message when matching null/undefined with toContain.

I was recently thrown off by the error message

```
minijasminenode/lib/jasmine-1.3.1.js:1142
return haystack.indexOf(needle) >= 0;
^
TypeError: Cannot call method 'indexOf' of null
```

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. (.../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.