Skip to content

Instantly share code, notes, and snippets.

@mokkabonna
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mokkabonna/301e53b19e726fb9dd7e to your computer and use it in GitHub Desktop.
Save mokkabonna/301e53b19e726fb9dd7e to your computer and use it in GitHub Desktop.
sinon shorter stack errors, add in assert.fail
fail: function fail(message) {
var error = new Error(message);
error.name = this.failException || assert.failException;
try{
throw error;
} catch(e) {
if (error.stack){
console.log(error.stack);
error.stack = error.stack.split('\n').slice(0,20).join('\n')
}
throw e;
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment