To use the seed:
- Clone the project using
git clone https://github.com/bmbarker90/karma-jasmine-seed {folder}
, replacing folder with the folder name you would like to give it - Set the remote to your own repo url
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
- Run
npm install
- We have provided 3 files for you:
- src/index.html for all of your HTML code
- src/index.js to start your JS code
- tests/test.spec.js to write your tests
- You are welcome to add more JS files in
/src
and more test files in/test
- To run tests, run
npm test
.
- Write a
describe
for each function that you would like to test - Pure functions are the easiest to test. Pure functions are functions that, given the same inputs, will always produce the same output
- Karma will watch changes to your files. This means that if you keep your terminal window open, it will re-run your tests any time you change your files!