That's great when you have only a single property on your object, but if your objects are full of properties (or even just have one property that's a really long string) the error output quickly becomes difficult to use.
It would be really handy if you could specify the output Expect.js should use. For instance, if the following lines:
if (value.toString) {
return value.toString();
}
are added to "format" (inside the "i" function) then a user could do:
Currently if you do something like:
you get output like:
That's great when you have only a single property on your object, but if your objects are full of properties (or even just have one property that's a really long string) the error output quickly becomes difficult to use.
It would be really handy if you could specify the output Expect.js should use. For instance, if the following lines:
are added to "format" (inside the "i" function) then a user could do:
and get the (much more useful) output:
(Of course, in a real world scenario that toString method would be defined on the class of our two objects, instead of on each object.)
Would it be possible to get something like this added to Expect.js?