www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 4731b8f905ee33bf56bf29fc8a108404e9419c5c
parent 45ddf9827ce9658576fbf4d30ac4193da421629b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  6 Feb 2018 01:25:44 -0500

Remove fail() override in Mocha

I'm not sure what this was for, but at least with an async test function
it seems to be causing spurious "the string 'x' was thrown, throw an
Error :)" messages that hide the real error.

Diffstat:
Mtest/content/runtests.js | 15---------------
1 file changed, 0 insertions(+), 15 deletions(-)

diff --git a/test/content/runtests.js b/test/content/runtests.js @@ -161,21 +161,6 @@ function Reporter(runner) { }); } -// Monkey-patch Mocha to check instanceof Error using compartment-local -// Error object -Mocha.Runner.prototype.fail = function(test, err){ - ++this.failures; - test.state = 'failed'; - - if ('string' == typeof err) { - err = new Error('the string "' + err + '" was thrown, throw an Error :)'); - } else if (!(err instanceof Components.utils.getGlobalForObject(err).Error)) { - err = new Error('the ' + Mocha.utils.type(err) + ' ' + Mocha.utils.stringify(err) + ' was thrown, throw an Error :)'); - } - - this.emit('fail', test, err); -}; - // Setup Mocha mocha.setup({ ui: "bdd",