modeset/teaspoon — pull request #233 by chancancode (2014-05-23 03:49:34+00:00)
Title: [WIP] Improved failure reporting to include the expected/actual result

If available, the reporters would now include the `expected` and `actual` result for each failed assertion. Currently, this is only supported by the qunit adapter.

Fixes #225

* * *

The qunit assertion API looks like this: `equal(actual, expected[, message]);`. When this fails, it'll pass `{actual: actual, expected: expected, message: message, source: , ...}` to the reporter. Most people don't bother putting a message in assertions like these, which is why it is often just reported as `undefined` in the teaspoon reporter.

I bumped into this issue when setting up teaspoon for our app, so I forked it and fixed it on a branch. This is how it looks like:

![teaspoon with expected/actual](https://dl.dropboxusercontent.com/s/gs6blneiib9b3o3/Screenshot%202014-05-22%2020.40.47.png)

I just need to work for our app, I suppose there are other things to consider before this can be accepted (code style, look/feel, tests, changelog, etc), and I'm not sure if I'll have time to do those in the near term. If someone has the time to pick this up, please feel free to use my commit as a starting point. Would love to see this merged into master.

References:
* https://github.com/modeset/teaspoon/blob/master/vendor/assets/javascripts/qunit/1.12.0.js#L922-L927
* https://github.com/modeset/teaspoon/blob/master/vendor/assets/javascripts/qunit/1.14.0.js#L436-L441

cc @cwick @jejacks0n