O'Reilly logo

Web App Testing Using Knockout.JS by Roberto Messora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello Jasmine

Working with Jasmine is quite easy. We have to perform the following steps:

  1. Download Jasmine 2.0 as a ZIP file from its hosting website on Github (https://github.com/pivotal/jasmine/tree/master/dist).
  2. Create a folder for the test project.
  3. Unzip the Jasmine package inside the folder created in step 2.
  4. Empty the spec and src subfolders deleting the example files.
  5. Add some source code to be tested in the src subfolder as .js files.
  6. Add some testing code using Jasmine in the spec subfolder as .js files.
  7. Add script references to the files added in steps 5 and 6 to the special file, SpecRunner.html.
  8. Open SpecRunner.html in a web browser to run the tests and verify the results.

This is clearly not a typical TDD coding cycle. We first write some ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required