summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/testing.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-10-30 09:22:17 +0100
committerXavier Morel <xmo@openerp.com>2012-10-30 09:22:17 +0100
commitf24cbe0795353a6c8355b31ac86d54af61f85cff (patch)
treec6bf33fdaa41a8ba8ce1032689aa9feaced0bc4f /addons/web/static/src/js/testing.js
parent5b1990bd18c50fad1aa96e4b8a93eb319dbd8646 (diff)
[FIX] don't apply teardown when setup fails
bzr revid: xmo@openerp.com-20121030082217-yjbh7j4apszsyg8l
Diffstat (limited to 'addons/web/static/src/js/testing.js')
-rw-r--r--addons/web/static/src/js/testing.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js
index 32a3624eb93..e124897f063 100644
--- a/addons/web/static/src/js/testing.js
+++ b/addons/web/static/src/js/testing.js
@@ -286,6 +286,9 @@ openerp.testing = {};
// Always execute tests asynchronously
stop();
+ var teardown = function () {
+ return opts.teardown(instance, $fixture, mock)
+ };
$.when(opts.setup(instance, $fixture, mock))
.pipe(function () {
var result = callback(instance, $fixture, mock);
@@ -299,11 +302,7 @@ openerp.testing = {};
+ "number of assertions they expect");
}
}
- return $.when(result);
- }).pipe(function () {
- return opts.teardown(instance, $fixture, mock);
- }, function () {
- return opts.teardown(instance, $fixture, mock);
+ return $.when(result).pipe(teardown, teardown);
}).always(function () {
start();
}).fail(function (error) {