Created
July 11, 2016 10:12
-
-
Save voxpelli/7eb6b0c9d72f720f35bee246588d1ca7 to your computer and use it in GitHub Desktop.
This small snippet leverages Mocha's reporter to do proper diffs of Chai assertion errors so that one can log them oneself as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mochaList = require('mocha').reporters.Base.list; | |
const mochaErrorLog = function (err, title) { | |
mochaList([{ | |
err, | |
fullTitle: () => title || 'Untitled' | |
}]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment