summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/testing.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/testing.js')
-rw-r--r--addons/web/static/src/js/testing.js25
1 files changed, 17 insertions, 8 deletions
diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js
index 983c8650e31..32a3624eb93 100644
--- a/addons/web/static/src/js/testing.js
+++ b/addons/web/static/src/js/testing.js
@@ -299,20 +299,29 @@ openerp.testing = {};
+ "number of assertions they expect");
}
}
- return $.when(result).fail(function (error) {
- if (options.fail_on_rejection === false) {
- return;
- }
- ok(false, typeof error === 'object' && error.message
- ? error.message
- : JSON.stringify([].slice.call(arguments)));
- })
+ return $.when(result);
}).pipe(function () {
return opts.teardown(instance, $fixture, mock);
}, function () {
return opts.teardown(instance, $fixture, mock);
}).always(function () {
start();
+ }).fail(function (error) {
+ if (options.fail_on_rejection === false) {
+ return;
+ }
+ var message;
+ if (typeof error !== 'object'
+ || typeof error.message !== 'string') {
+ message = JSON.stringify([].slice.apply(arguments));
+ } else {
+ message = error.message;
+ if (error.data && error.data.debug) {
+ message += '\n\n' + error.data.debug;
+ }
+ }
+
+ ok(false, message);
});
});
};