jquery/qunit — pull request #300 by vivin (2012-08-09 18:34:25+00:00)
Title: Assertion information to callback

This includes the previous callback changes along with the addition of assertion information to the information returned by `log`.

The rationale for adding assertion information is as follows:

- The assertion-type provides information about the type of assertion that was violated. This is pretty useful when doing automated tests with PhantomJS and QUnit.
- Currently the `throws` assertion has an expected value of `null`. This is because the expected value can be a regular expression. When reporting the results of tests, we can tell whether the test failed or not by examining the `result` property from `log`. However, the decision to show `expected` and `actual` values (which don't apply in the case of `throws` when using a regular expression) cannot be safely made by simply examining the `expected` value and checking if it is null. There can be cases where `null` is an actual expected-value. Instead, it would be safer and more obvious to look at the `assertionType` property and decide whether to show the `expected` and `actual` values. This problem also exists in the current QUnit report. When a `throws` assertion that expects an exception fails (and it uses a regular expression), the expected value is shown as `null`, which is not correct. In this case, we could simply examine the `assertionType` property and decide to not show the expected and actual values if the assertion was a `throws` assertion.