knockout/knockout — pull request #1237 by pimterry (2013-12-04 10:05:24+00:00)
Title: Improve '.throwsContaining' matcher error message

Currently the throws containing matcher returns very unhelpful error messages in tests. This makes it wildly more informative.

If the function does not throw an exception, it used to return:

`Expected undefined to throw containing 'qwe'.`

it now returns;

`Expected function () { } to throw exception containing 'qwe', but it did not throw anything`.

If the function throws the wrong exceptions, it used to return:

`Expected 'asd' to throw containing 'qwe'.`

it now returns:

`Expected function () { throw new Error("asd"); } to throw exception containing 'qwe', but it threw 'asd'`.