Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you run Jasmine tests in the browser?

I'm using jasmine-npm. jasmine-init sets it up such that you could run jasmine in the terminal to test your code.

I recall seeing these tests in the browser before and would like to see them there. How would I run the tests in the browser? (This seems like this should be something that's easy to research, but I swear that I've spent over 2 hours researching this and can't figure it out).

like image 644
Adam Zerner Avatar asked Feb 24 '15 00:02

Adam Zerner


1 Answers

Option 1:

JASMINE STANDALONE

Included is a sample app and sample tests. Open SpecRunner.html and run the included specs. Both the source files and their respective specs are linked in the of the SpecRunner.html.

To start using Jasmine, replace the source/spec files with your own.

Load the SpecRunner.html in your favorite browser

https://jasmine.github.io/pages/getting_started.html

Option 2: https://github.com/airportyh/testem.

like image 141
Adam Zerner Avatar answered Sep 27 '22 20:09

Adam Zerner