expect(myObject.myFunction).toHaveBeenCalledWith(anotherObject, andAnotherObject)
When the line passes, all is well. When it fails I get an error that looks like:
Error: Expected spy myFunctionto have been called with [ Object({ log: Logger({ domain: null, _events: Object({ }), _maxListeners: undefined, _level: 20, streams: [ Object({ level: 20, stream: Socket({ _connecting: false, _hadError: false, _handle: [object Pipe], _parent: null, _host: null, _readableState: ReadableState({ objectMode: false, highWaterMark: 16384, buffer: [ ], length: 0, pipes: null, pipesCount: 0, flowing: null, ended: false, endEmitted: false, reading: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null }), readable: false, domain: null, _events: Object({ end: Function, finish: Function, _socketEnd: Function }), _maxListeners: undefined, _writableState: WritableState({ objectMode: false, highWaterMark: 16384, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncodin
<SNIP>
Add about 1000 lines to the above and you'll have what I've got. It turns out this is because I'm attaching a reference to a Bunyan logger and Jasmine does a JSON.stringify (or something similar) when outputting logs.
It would be great if it would instead use the toString function I've overridden instead when printing logs. Is this possible?
Cheers,
Pete