From 21a65f181eebc3f2c0cd43fb3383ee3de673745b Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 16 Sep 2015 10:35:29 +0200 Subject: Add throw error for undefined method on plugins --- js/tests/unit/tab.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/tests/unit/tab.js') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 1eed75e90..2e0143293 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.tab, undefined, 'tab was set back to undefined (org value)') }) + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('
') + $el.bootstrapTab() + try { + $el.bootstrapTab('noMethod') + } + catch (err) { + assert.strictEqual(err.message, 'No method named "noMethod"') + } + }) + QUnit.test('should return jquery collection containing the element', function (assert) { assert.expect(2) var $el = $('
') -- cgit v1.2.3