code4sac / wicit

A simple node/express app for finding locations that accept WIC in California, using data from the new California Department of Public Health open data portal.
http://findwic.com/
MIT License
19 stars 20 forks source link

Testing #5 Add Karma Test Framework #39

Closed mikyladewitt closed 9 years ago

mikyladewitt commented 9 years ago

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.

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 the karma: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

mikyladewitt commented 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.

jesserosato commented 9 years ago

@mikyladewitt Thank you so much for this! Sorry for the delay in merging it in.