Closed mikyladewitt closed 9 years ago
Sorry this took so long. I finally have some free time again, but I wanted to check in what I have so others can start writing tests as well. I included one test for the GeoLocation Service so there is an example of a test, but the other tests I had started were not very good so I didn't check them in.
@mikyladewitt Thank you so much for this! Sorry for the delay in merging it in.
This includes the Karma test framework and one jasmine test that tests the GeolocationService.
Karma Framework
Overview
The Karma Framework works as follows:
Code Coverage
Karma will also calculate the code coverage based on the tests run. The code coverage is located in the coverage folder in the root. This is git ignored as it is built automatically and changes everytimes the codebase and/or tests change.
Running Karma
Karma has two ways it can be run.
grunt karma:unit
- One single run. Runs all the tests once and exits.grunt karma:dev
- Continuous, development run. Runs all the tests then listens for changes to tests or files and re-runs all specified tests on every change.Karma in the Build Process\Development
Karma tests will automatically be run with the
grunt build-dev
task. If the tests fail, the build will fail. For the build, the tests will use the single run using thekarma:unit
target.To run Karma, during development, it is best to use the continuous version if you are making a lot of changes. This can be executed by running the following command:
grunt karma:dev