GETTING STARTED
Jasmine for Node.js
Add Jasmine to your package.json
npm install --save-dev jasmine
Initialize Jasmine in your project
npx jasmine init
Set jasmine as your test script in your package.json
"scripts": { "test": "jasmine" }
Run your tests
npm test
Jasmine for Browsers
Add Jasmine to your package.json
npm install --save-dev jasmine-browser-runner jasmine-core
Initialize Jasmine in your project
npx jasmine-browser-runner init
Set jasmine as your test script in your package.json
"scripts": { "test": "jasmine-browser-runner runSpecs" }
Run your tests
npm test
Jasmine Standalone
The standalone distribution provides a simple way to run your specs in a web browser. You can download it from the releases page.
Included is a sample app and sample specs. Open SpecRunner.html and run the included specs. Both the source files and their respective specs are linked in the <head> of the SpecRunner.html.
To start using Jasmine, replace the source/spec files with your own. Then Load the SpecRunner.html in your favorite browser