Jasmine tests are separated in two separate files. One is for HTML view, and it is called, like, myFile.Specrunner.html, second is javascript file, which will be used for testing our javascript.

In beforeEach section we can put things which have to be executed before starting test. In my case, for example, I needed to add Resources, something like:


describe("Add notification rule", function() {
	beforeEach(function() {
		Resource = {
			Notification_Choose_parameter: 'Choose Parameter'
			,Component_Notification_Position: 'test'

Otherwise I was receiving error "Resource not found".

In the HTML file, if I need some HTML I can add it on the of file, in my case, I needed something like:


	<button id="cleanApply" data-bind="click: cleanApply">Click to apply "clean" - without any model - bindings</button>
	<button id="addPredefCars" data-bind="click: addPredefCars">Click to apply bindings with predefined type and subtype (example for 

All javascript files which are needed for testing are in HTML file.

Then, for example, I was testing addCars method from my "add cars"  example:


describe("Add cars", function() {
	it("add two type of cars", function() {
		var target = new CarsViewModel();

My Jasmine example you can see here.