From c44578ee1a570829be0ff44541dc62329f7685f0 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 10 May 2017 16:10:25 +0200 Subject: [PATCH] [IMP] web: improve qunit logging and config When a qunit test fails, the log only contains the assertion message. This is in fact useful to have the "actual" and "expected" values to understand the bug. Also, we recently updated the configuration so that the "hide passed tests" option is enabled by default. This is in fact useful to have it disabled if the user wants to run only one test (debugging). --- addons/web/static/tests/helpers/qunit_config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/tests/helpers/qunit_config.js b/addons/web/static/tests/helpers/qunit_config.js index c161fc95d23..3c6ca165036 100644 --- a/addons/web/static/tests/helpers/qunit_config.js +++ b/addons/web/static/tests/helpers/qunit_config.js @@ -36,7 +36,7 @@ QUnit.config.testTimeout = 1 * 60 * 1000; /** * Hide passed tests by default in the QUnit page */ -QUnit.config.hidepassed = true; +QUnit.config.hidepassed = (window.location.href.match(/[?&]testId=/) === null); var sortButtonAppended = false; @@ -67,6 +67,8 @@ QUnit.log(function( result) { console.log('"' + result.name + '"', 'in section', '"' + result.module + '"', 'failed:', result.message); + console.log('actual:', result.actual); + console.log('expected:', result.expected); } });