From 577bf8b14d76a864a8d69dbfb03b757fbeb6e241 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 9 Oct 2019 01:27:43 +0300 Subject: [PATCH] Rename "js/tests/units" to "js/tests/unit". (#29503) --- js/tests/README.md | 4 ++-- js/tests/karma.conf.js | 6 +++--- js/tests/{units => unit}/.eslintrc.json | 0 js/tests/{units => unit}/alert.spec.js | 0 js/tests/{units => unit}/button.spec.js | 0 js/tests/{units => unit}/carousel.spec.js | 0 js/tests/{units => unit}/collapse.spec.js | 0 js/tests/{units => unit}/dom/data.spec.js | 0 js/tests/{units => unit}/dom/event-handler.spec.js | 0 js/tests/{units => unit}/dom/manipulator.spec.js | 0 js/tests/{units => unit}/dom/selector-engine.spec.js | 0 js/tests/{units => unit}/dropdown.spec.js | 0 js/tests/{units => unit}/modal.spec.js | 0 js/tests/{units => unit}/popover.spec.js | 0 js/tests/{units => unit}/scrollspy.spec.js | 0 js/tests/{units => unit}/tab.spec.js | 0 js/tests/{units => unit}/toast.spec.js | 0 js/tests/{units => unit}/tooltip.spec.js | 0 js/tests/{units => unit}/util/index.spec.js | 0 js/tests/{units => unit}/util/sanitizer.spec.js | 0 20 files changed, 5 insertions(+), 5 deletions(-) rename js/tests/{units => unit}/.eslintrc.json (100%) rename js/tests/{units => unit}/alert.spec.js (100%) rename js/tests/{units => unit}/button.spec.js (100%) rename js/tests/{units => unit}/carousel.spec.js (100%) rename js/tests/{units => unit}/collapse.spec.js (100%) rename js/tests/{units => unit}/dom/data.spec.js (100%) rename js/tests/{units => unit}/dom/event-handler.spec.js (100%) rename js/tests/{units => unit}/dom/manipulator.spec.js (100%) rename js/tests/{units => unit}/dom/selector-engine.spec.js (100%) rename js/tests/{units => unit}/dropdown.spec.js (100%) rename js/tests/{units => unit}/modal.spec.js (100%) rename js/tests/{units => unit}/popover.spec.js (100%) rename js/tests/{units => unit}/scrollspy.spec.js (100%) rename js/tests/{units => unit}/tab.spec.js (100%) rename js/tests/{units => unit}/toast.spec.js (100%) rename js/tests/{units => unit}/tooltip.spec.js (100%) rename js/tests/{units => unit}/util/index.spec.js (100%) rename js/tests/{units => unit}/util/sanitizer.spec.js (100%) diff --git a/js/tests/README.md b/js/tests/README.md index dd2cc0f1b9..8823d05dc5 100644 --- a/js/tests/README.md +++ b/js/tests/README.md @@ -1,6 +1,6 @@ ## How does Bootstrap's test suite work? -Bootstrap uses [Jasmine](https://jasmine.github.io/). Each plugin has a file dedicated to its tests in `tests/units/.spec.js`. +Bootstrap uses [Jasmine](https://jasmine.github.io/). Each plugin has a file dedicated to its tests in `tests/unit/.spec.js`. * `visual/` contains "visual" tests which are run interactively in real browsers and require manual verification by humans. @@ -9,7 +9,7 @@ To run the unit test suite via [Karma](https://karma-runner.github.io/) and debu ## How do I add a new unit test? -1. Locate and open the file dedicated to the plugin which you need to add tests to (`tests/units/.spec.js`). +1. Locate and open the file dedicated to the plugin which you need to add tests to (`tests/unit/.spec.js`). 2. Review the [Jasmine API Documentation](https://jasmine.github.io/pages/docs_home.html) and use the existing tests as references for how to structure your new tests. 3. Write the necessary unit test(s) for the new or revised functionality. 4. Run `npm run js-test` to see the results of your newly-added test(s). diff --git a/js/tests/karma.conf.js b/js/tests/karma.conf.js index 8e30094104..624f5f638a 100644 --- a/js/tests/karma.conf.js +++ b/js/tests/karma.conf.js @@ -58,15 +58,15 @@ const conf = { }, files: [ 'node_modules/hammer-simulator/index.js', - { pattern: 'js/tests/units/**/*.spec.js', watched: !browserStack } + { pattern: 'js/tests/unit/**/*.spec.js', watched: !browserStack } ], preprocessors: { - 'js/tests/units/**/*.spec.js': ['rollup'] + 'js/tests/unit/**/*.spec.js': ['rollup'] }, rollupPreprocessor: { plugins: [ istanbul({ - exclude: ['js/tests/units/**/*.spec.js', 'js/tests/helpers/**/*.js'] + exclude: ['js/tests/unit/**/*.spec.js', 'js/tests/helpers/**/*.js'] }), babel({ // Only transpile our source code diff --git a/js/tests/units/.eslintrc.json b/js/tests/unit/.eslintrc.json similarity index 100% rename from js/tests/units/.eslintrc.json rename to js/tests/unit/.eslintrc.json diff --git a/js/tests/units/alert.spec.js b/js/tests/unit/alert.spec.js similarity index 100% rename from js/tests/units/alert.spec.js rename to js/tests/unit/alert.spec.js diff --git a/js/tests/units/button.spec.js b/js/tests/unit/button.spec.js similarity index 100% rename from js/tests/units/button.spec.js rename to js/tests/unit/button.spec.js diff --git a/js/tests/units/carousel.spec.js b/js/tests/unit/carousel.spec.js similarity index 100% rename from js/tests/units/carousel.spec.js rename to js/tests/unit/carousel.spec.js diff --git a/js/tests/units/collapse.spec.js b/js/tests/unit/collapse.spec.js similarity index 100% rename from js/tests/units/collapse.spec.js rename to js/tests/unit/collapse.spec.js diff --git a/js/tests/units/dom/data.spec.js b/js/tests/unit/dom/data.spec.js similarity index 100% rename from js/tests/units/dom/data.spec.js rename to js/tests/unit/dom/data.spec.js diff --git a/js/tests/units/dom/event-handler.spec.js b/js/tests/unit/dom/event-handler.spec.js similarity index 100% rename from js/tests/units/dom/event-handler.spec.js rename to js/tests/unit/dom/event-handler.spec.js diff --git a/js/tests/units/dom/manipulator.spec.js b/js/tests/unit/dom/manipulator.spec.js similarity index 100% rename from js/tests/units/dom/manipulator.spec.js rename to js/tests/unit/dom/manipulator.spec.js diff --git a/js/tests/units/dom/selector-engine.spec.js b/js/tests/unit/dom/selector-engine.spec.js similarity index 100% rename from js/tests/units/dom/selector-engine.spec.js rename to js/tests/unit/dom/selector-engine.spec.js diff --git a/js/tests/units/dropdown.spec.js b/js/tests/unit/dropdown.spec.js similarity index 100% rename from js/tests/units/dropdown.spec.js rename to js/tests/unit/dropdown.spec.js diff --git a/js/tests/units/modal.spec.js b/js/tests/unit/modal.spec.js similarity index 100% rename from js/tests/units/modal.spec.js rename to js/tests/unit/modal.spec.js diff --git a/js/tests/units/popover.spec.js b/js/tests/unit/popover.spec.js similarity index 100% rename from js/tests/units/popover.spec.js rename to js/tests/unit/popover.spec.js diff --git a/js/tests/units/scrollspy.spec.js b/js/tests/unit/scrollspy.spec.js similarity index 100% rename from js/tests/units/scrollspy.spec.js rename to js/tests/unit/scrollspy.spec.js diff --git a/js/tests/units/tab.spec.js b/js/tests/unit/tab.spec.js similarity index 100% rename from js/tests/units/tab.spec.js rename to js/tests/unit/tab.spec.js diff --git a/js/tests/units/toast.spec.js b/js/tests/unit/toast.spec.js similarity index 100% rename from js/tests/units/toast.spec.js rename to js/tests/unit/toast.spec.js diff --git a/js/tests/units/tooltip.spec.js b/js/tests/unit/tooltip.spec.js similarity index 100% rename from js/tests/units/tooltip.spec.js rename to js/tests/unit/tooltip.spec.js diff --git a/js/tests/units/util/index.spec.js b/js/tests/unit/util/index.spec.js similarity index 100% rename from js/tests/units/util/index.spec.js rename to js/tests/unit/util/index.spec.js diff --git a/js/tests/units/util/sanitizer.spec.js b/js/tests/unit/util/sanitizer.spec.js similarity index 100% rename from js/tests/units/util/sanitizer.spec.js rename to js/tests/unit/util/sanitizer.spec.js