Skip to content

Commit bdab948

Browse files
committed
Remove unneeded conditional
1 parent af52795 commit bdab948

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

js/tests/unit/alert.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
$(function () {
22
'use strict'
33

4+
window.Alert = typeof bootstrap !== 'undefined' ? bootstrap.Alert : Alert
5+
46
QUnit.module('alert plugin')
57

68
QUnit.test('should be defined on jquery object', function (assert) {
@@ -114,10 +116,6 @@ $(function () {
114116
QUnit.test('should return alert version', function (assert) {
115117
assert.expect(1)
116118

117-
if (typeof Alert !== 'undefined') {
118-
assert.strictEqual(typeof Alert.VERSION, 'string')
119-
} else {
120-
assert.notOk()
121-
}
119+
assert.strictEqual(typeof Alert.VERSION, 'string')
122120
})
123121
})

js/tests/unit/button.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
$(function () {
22
'use strict'
33

4+
window.Button = typeof bootstrap !== 'undefined' ? bootstrap.Button : Button
5+
46
QUnit.module('button plugin')
57

68
QUnit.test('should be defined on jquery object', function (assert) {
@@ -472,10 +474,6 @@ $(function () {
472474
QUnit.test('should return button version', function (assert) {
473475
assert.expect(1)
474476

475-
if (typeof Button !== 'undefined') {
476-
assert.strictEqual(typeof Button.VERSION, 'string')
477-
} else {
478-
assert.notOk()
479-
}
477+
assert.strictEqual(typeof Button.VERSION, 'string')
480478
})
481479
})

js/tests/unit/toast.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
$(function () {
22
'use strict'
33

4-
if (typeof bootstrap !== 'undefined') {
5-
window.Toast = bootstrap.Toast
6-
}
4+
window.Toast = typeof bootstrap !== 'undefined' ? bootstrap.Toast : Toast
75

86
QUnit.module('toast plugin')
97

0 commit comments

Comments
 (0)