diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-05-16 09:18:10 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-05-16 14:41:03 +0200 |
| commit | c3ca877d81e6d36af2977bbc6ce2ac5b068d05ca (patch) | |
| tree | e456f63f670465b4eb566f5b223f172d75fc0568 /addons/web/static | |
| parent | 15a227375a4b73e20761acf18506aad302701c4c (diff) | |
[IMP] web: better error logging for qunit tests
Before this commit, when a test in the qunit test suite failed, the
error displayed by the runbot was not really interesting. It just said
that test_01_js failed. With this commit, each assertion error is now
logged as an error, which means that they are displayed in the short
error log by the runbot.
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/tests/helpers/qunit_config.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/addons/web/static/tests/helpers/qunit_config.js b/addons/web/static/tests/helpers/qunit_config.js index 3c6ca165036..641d3a6f09b 100644 --- a/addons/web/static/tests/helpers/qunit_config.js +++ b/addons/web/static/tests/helpers/qunit_config.js @@ -62,13 +62,18 @@ QUnit.done(function(result) { * This logs various data in the console, which will be available in the log * .txt file generated by the runbot. */ -QUnit.log(function( result) { +QUnit.log(function (result) { if (!result.result) { - console.log('"' + result.name + '"', - 'in section', '"' + result.module + '"', - 'failed:', result.message); - console.log('actual:', result.actual); - console.log('expected:', result.expected); + var info = '"QUnit test failed: "' + result.module + ' > ' + result.name + '"'; + info += ' [message: "' + result.message + '"'; + if (result.actual !== null) { + info += ', actual: "' + result.actual + '"'; + } + if (result.expected !== null) { + info += ', expected: "' + result.expected + '"'; + } + info += ']'; + console.error(info); } }); |
