index.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <title>Bootstrap Plugin Test Suite</title>
  7. <!-- jQuery -->
  8. <script src="../../node_modules/jquery/dist/jquery.slim.min.js"></script>
  9. <script src="../../node_modules/popper.js/dist/umd/popper.min.js"></script>
  10. <!-- QUnit -->
  11. <link rel="stylesheet" href="../../node_modules/qunit/qunit/qunit.css" media="screen">
  12. <script src="../../node_modules/qunit/qunit/qunit.js"></script>
  13. <!-- Sinon -->
  14. <script src="../../node_modules/sinon/pkg/sinon-no-sourcemaps.js"></script>
  15. <!-- Hammer simulator -->
  16. <script src="../../node_modules/hammer-simulator/index.js"></script>
  17. <script>
  18. // Disable jQuery event aliases to ensure we don't accidentally use any of them
  19. [
  20. 'blur',
  21. 'focus',
  22. 'focusin',
  23. 'focusout',
  24. 'resize',
  25. 'scroll',
  26. 'click',
  27. 'dblclick',
  28. 'mousedown',
  29. 'mouseup',
  30. 'mousemove',
  31. 'mouseover',
  32. 'mouseout',
  33. 'mouseenter',
  34. 'mouseleave',
  35. 'change',
  36. 'select',
  37. 'submit',
  38. 'keydown',
  39. 'keypress',
  40. 'keyup',
  41. 'contextmenu'
  42. ].forEach(function(eventAlias) {
  43. $.fn[eventAlias] = function() {
  44. throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js')
  45. }
  46. })
  47. // Require assert.expect in each test
  48. QUnit.config.requireExpects = true
  49. // See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
  50. var log = []
  51. var testName
  52. QUnit.done(function(testResults) {
  53. var tests = []
  54. for (var i = 0; i < log.length; i++) {
  55. var details = log[i]
  56. tests.push({
  57. name: details.name,
  58. result: details.result,
  59. expected: details.expected,
  60. actual: details.actual,
  61. source: details.source
  62. })
  63. }
  64. testResults.tests = tests
  65. window.global_test_results = testResults
  66. })
  67. QUnit.testStart(function(testDetails) {
  68. QUnit.log(function(details) {
  69. if (!details.result) {
  70. details.name = testDetails.name
  71. log.push(details)
  72. }
  73. })
  74. })
  75. // Display fixture on-screen on iOS to avoid false positives
  76. // See https://github.com/twbs/bootstrap/pull/15955
  77. if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
  78. QUnit.begin(function() {
  79. $('#qunit-fixture').css({ top: 0, left: 0 })
  80. })
  81. QUnit.done(function() {
  82. $('#qunit-fixture').css({ top: '', left: '' })
  83. })
  84. }
  85. </script>
  86. <!-- Transpiled Plugins -->
  87. <script src="../dist/util.js"></script>
  88. <script src="../dist/alert.js"></script>
  89. <script src="../dist/button.js"></script>
  90. <script src="../dist/carousel.js"></script>
  91. <script src="../dist/collapse.js"></script>
  92. <script src="../dist/dropdown.js"></script>
  93. <script src="../dist/modal.js"></script>
  94. <script src="../dist/scrollspy.js"></script>
  95. <script src="../dist/tab.js"></script>
  96. <script src="../dist/tooltip.js"></script>
  97. <script src="../dist/popover.js"></script>
  98. <script src="../dist/toast.js"></script>
  99. <!-- Unit Tests -->
  100. <script src="unit/alert.js"></script>
  101. <script src="unit/button.js"></script>
  102. <script src="unit/carousel.js"></script>
  103. <script src="unit/collapse.js"></script>
  104. <script src="unit/dropdown.js"></script>
  105. <script src="unit/modal.js"></script>
  106. <script src="unit/scrollspy.js"></script>
  107. <script src="unit/tab.js"></script>
  108. <script src="unit/tooltip.js"></script>
  109. <script src="unit/popover.js"></script>
  110. <script src="unit/util.js"></script>
  111. <script src="unit/toast.js"></script>
  112. </head>
  113. <body>
  114. <div id="qunit-container">
  115. <div id="qunit"></div>
  116. <div id="qunit-fixture"></div>
  117. </div>
  118. </body>
  119. </html>