diff options
| author | Johann-S <[email protected]> | 2017-10-23 09:35:27 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2017-10-23 10:35:27 +0300 |
| commit | 1487c3a9947b0eb55c61b5d93ff9f0c69a812aeb (patch) | |
| tree | 5f05dafe9448cb79d9ea8ffa2dc86a15d3f59ea6 /js/tests/unit | |
| parent | 0d71a8a738688455746e91f7806fa0515c96d263 (diff) | |
| download | bootstrap-1487c3a9947b0eb55c61b5d93ff9f0c69a812aeb.tar.xz bootstrap-1487c3a9947b0eb55c61b5d93ff9f0c69a812aeb.zip | |
Add `Util.jQuery` which will detect jQuery instead of relying on global `$` (#24513)
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/util.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/util.js b/js/tests/unit/util.js new file mode 100644 index 000000000..c3412041e --- /dev/null +++ b/js/tests/unit/util.js @@ -0,0 +1,19 @@ +$(function () { + 'use strict' + + QUnit.module('Util') + + QUnit.test('Util.jQuery should find window.jQuery if window.$ is not available', function (assert) { + assert.expect(1) + delete window.$ + assert.strictEqual(Util.jQuery, window.jQuery) + window.$ = Util.jQuery + }) + + QUnit.test('Util.jQuery should find window.$ if window.jQuery is not available', function (assert) { + assert.expect(1) + delete window.jQuery + assert.strictEqual(Util.jQuery, window.$) + window.jQuery = Util.jQuery + }) +}) |
