mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
360259e2b2
Also, workaround issues with QUnit Chrome bridge: the Chrome bridge from `grunt-contrib-qunit` is now getting injected into every single iframe, including an empty one that has no intention of running QUnit tests. Since that bridge requires QUnit, it fails with an error in such cases. Workaround the issue by wrapping the bridge in another function that bails early if QUnit is not defined. Ref gh-2157
21 lines
623 B
Plaintext
21 lines
623 B
Plaintext
// The bridge in `node_modules/grunt-contrib-qunit/chrome/bridge.js` is injected
|
|
// into every iframe, even an empty one injected during QUnit tests. The bridge,
|
|
// in turn, requires QUnit to be present on the page, throwing errors otherwise.
|
|
// To workaround that, add another wrapper which detects a missing QUnit and skips
|
|
// the whole logic.
|
|
|
|
( function ( factory ) {
|
|
if ( typeof define === 'function' && define.amd ) {
|
|
require( [ 'qunit' ], factory );
|
|
} else {
|
|
factory( window.QUnit );
|
|
}
|
|
} )( function( QUnit ) {
|
|
|
|
if ( !QUnit ) {
|
|
|
|
// No QUnit => possibly an empty iframe injected in tests; ignore.
|
|
return;
|
|
}
|
|
|