1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-22 13:13:03 +02:00

return to the original file structure to avoid breaking modularity

This commit is contained in:
Johann-S
2019-10-02 11:43:54 +02:00
parent 393ddae09b
commit 3d12b541c4
35 changed files with 172 additions and 186 deletions

View File

@@ -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 `src/<plugin-name>/<plugin-name>.spec.js`.
Bootstrap uses [Jasmine](https://jasmine.github.io/). Each plugin has a file dedicated to its tests in `tests/units/<plugin-name>.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 (`src/<plugin-name>/<plugin-name>.spec.js`).
1. Locate and open the file dedicated to the plugin which you need to add tests to (`tests/units/<plugin-name>.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).
@@ -26,7 +26,7 @@ To run the unit test suite via [Karma](https://karma-runner.github.io/) and debu
## Code coverage
Currently we're aiming for at least 90% test coverage for our code. To ensure your changes meet or exceed this limit, run `npm run js-compile && npm run js-test` and open the file in `js/coverage/lcov-report/index.html` to see the code coverage for each plugin. See more details when you select a plugin and ensure your change is fully covered by unit tests.
Currently we're aiming for at least 90% test coverage for our code. To ensure your changes meet or exceed this limit, run `npm run js-test-karma` and open the file in `js/coverage/lcov-report/index.html` to see the code coverage for each plugin. See more details when you select a plugin and ensure your change is fully covered by unit tests.
### Example tests