Jasmine Setup
The first time using Jasmine. This is step by step example:
- Download the latest version
- Delete files in /src and /spec
- Add source files to /src: HelloWorld.js
function helloWorld() {
return "Hello World!";
}
- Add test files to /spec: HelloWorldSpec.js
describe("Hello world", function() {
it("says hello", function() {
expect(helloWorld()).toEqual("Hello world!");
});
});
- Edit file SpecRunner.html: include source and spec files in include source files here and include spec files here
- Run the SpecRunner.html
Visit Jasmine home for more assert statements.
References:
Posted in testing testing jasmine frontend
29 May 2013