]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
fix(util): increase util coverage
authorJohann-S <johann.servoire@gmail.com>
Sat, 16 Jun 2018 20:33:17 +0000 (22:33 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 20 Feb 2019 20:05:45 +0000 (22:05 +0200)
js/tests/unit/util.js

index 858fee6f4d024dce816edf905d999f2f55b43d2e..fa930dcac23ef5f7f922c8c66356153dbef263c7 100644 (file)
@@ -160,4 +160,22 @@ $(function () {
       sandbox.restore()
     }
   })
+
+  QUnit.test('noop should return an empty function', function (assert) {
+    assert.expect(1)
+    Util.noop().call()
+    assert.ok(typeof Util.noop() === 'function')
+  })
+
+  QUnit.test('should return jQuery if present', function (assert) {
+    assert.expect(2)
+
+    assert.equal(Util.jQuery, $)
+
+    $.noConflict()
+
+    assert.equal(Util.jQuery, jQuery)
+
+    window.$ = jQuery
+  })
 })