Debian Codegraph @

tests/lib/grunt-contrib-qunit-bridges/bridge-wrapper.js.intro

raw
1 // The bridge in `node_modules/grunt-contrib-qunit/chrome/bridge.js` is injected
2 // into every iframe, even an empty one injected during QUnit tests. The bridge,
3 // in turn, requires QUnit to be present on the page, throwing errors otherwise.
4 // To workaround that, add another wrapper which detects a missing QUnit and skips
5 // the whole logic.
6
7 ( function ( factory ) {
8 if ( typeof define === 'function' && define.amd ) {
9 require( [ 'qunit' ], factory );
10 } else {
11 factory( window.QUnit );
12 }
13 } )( function( QUnit ) {
14
15 if ( !QUnit ) {
16
17 // No QUnit => possibly an empty iframe injected in tests; ignore.
18 return;
19 }
20