Skip to content

Commit

Permalink
[INTERNAL][FIX] QUnit 1.x: support predefined QUnit.config
Browse files Browse the repository at this point in the history
Without this fix, QUnit 1.x starts its queue immediately when it is
loaded after DOMContentloaded. Test providers have no chance to
configure autostart:false in that case.

The fix is a downport of QUnit's own fix for
qunitjs/qunit#1059 .

Change-Id: If806792ddb21a79eeb71b59ab33dc443aa29934c
  • Loading branch information
codeworrior committed Jul 19, 2018
1 parent 261b02e commit 46b7cce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/sap.ui.core/src/sap/ui/thirdparty/qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ config = {
callbacks: {}
};

//### BEGIN MODIFIED BY SAP
// downport of fix for https://github.com/qunitjs/qunit/issues/1059
// take a predefined QUnit.config and extend the defaults
var globalConfig = window && window.QUnit && window.QUnit.config;

// only extend the global config if there is no QUnit overload
if (window && window.QUnit && !window.QUnit.version) {
extend(config, globalConfig);
}
//### END MODIFIED BY SAP

// Push a loose unnamed module to the modules collection
config.modules.push( config.currentModule );

Expand Down

0 comments on commit 46b7cce

Please sign in to comment.