Skip to content
madhuka edited this page Nov 26, 2013 · 4 revisions

This Test-frame work for js (jaggery)

It is will using jasmine[1] as test engine core in test module. It is for jaggery[2]

this project contains

two folders one for modules and other one for sample jaggery app. test - it is module called 'test' 'testingApp' have to directories means two application called

  • demobyjag - This will be testing jasmine with moule - very basic test
  • demobymodule - This will be using 'test' mdules that is created.
  • automobile - This sample to test Car 'car.js' It have sample 5 test have writting

To test

Added copy the 'demobymodule' folder inside 'jaggery-test-framewrok\testingApp' to jaggery (\apps)

Then copy the 'test' module in 'jaggery-test-framewrok\module' to jaggery (\modules)

Then start jaggery server from 'server.bat/.sh' in \bin

After server started go to 'http://localhost:9763/demobymodule/test/mytest/mytest.jag'

For Getting JSON out put

http://localhost:9763/demobymodule/test/mytest/mytest.jag

Get Spec

http://localhost:9763/demobymodule/test/mytest/mytest.jag?spec=Aspec

For App 'automobile'

copy the folder named 'automobile' in 'jaggery-test-framewrok\testingApp' to \app

make sure you have copy 'test' module in to \modules

Then Go to URL to run the test

run only specific test go to below URL

Here is out of json


{ elapsedTime: "23ms", specsCount: 5, specsPassed: 5, specsFailed: 0, suites: [ { suite: "TestSuiteOne", spec: "Testing Car name and Engineer size is validate to Drive", passed: true, itemCount: 2, passedCount: 2, failedCount: 0, skipped: false, items: [ { type: "expect", message: "Passed." }, { type: "expect", message: "Passed." } ] }, { suite: "TurningEngine", spec: "Checking testing platform is turned to test", passed: true, itemCount: 1, passedCount: 1, failedCount: 0, skipped: false, items: [ { type: "expect", message: "Passed." } ] }, { suite: "TurningEngine", spec: "Checking Engineer capacity for Express way to ride", passed: true, itemCount: 1, passedCount: 1, failedCount: 0, skipped: false, items: [ { type: "expect", message: "Passed." } ] }, ] } ] }


More details regard to this repo and task can be found in here

[1] http://pivotal.github.io/jasmine/ [2] http://jaggeryjs.org/ [3] http://madhukaudantha.blogspot.com/