Conditional output expectations
Some output differs based on environment. For instance:
x = null;
x.y;
That says something like TypeError: x is null in Firefox, and TypeError: Cannot read property 'y' of null in Chrome. Neither one is "right" per se. You could just use ... to ignore the content entirely, but that's not super.
Instead, something like:
/* == when userAgent('Chrome')
=> Error: TypeError: Cannot read property 'y' of null
== when userAgent('Firefox')
=> Error: TypeError: x is null
*/
The code after when would be an expression, with some helpers available like a function for simple user-agent selection.
Another variant would be to allow a set of different results:
// => Error: TypeError: Cannot read property 'y' of null {or} Error: TypeError: x is null
I agree a simple "or" is probably good enough, instead of conditional expressions. But maybe like:
// => Error: TypeError Cannot ...
// OR => Error: TypeError: x is null
Ah, yea, that's much cleaner :P