I am currently working on some test cases for my website. I've managed to test the back-end functionality using the simple-test framework.
I have some important javascript tools that requires some automatic testing. I know javascript is a client side language and it requires a browser, i am just wondering if its something i can do.
Notice the test must run from Linux CLI.
Thank you
I am currently working on some test cases for my website. I've managed to test the back-end functionality using the simple-test framework.
I have some important javascript tools that requires some automatic testing. I know javascript is a client side language and it requires a browser, i am just wondering if its something i can do.
Notice the test must run from Linux CLI.
Thank you
Share Improve this question asked Mar 30, 2012 at 9:16 keepwalkingkeepwalking 2,6546 gold badges32 silver badges64 bronze badges 03 Answers
Reset to default 2You can install node.js with jasmine-node package to run your tests using cli:
Here's a brief intro to Jasmine:
http://net.tutsplus./tutorials/javascript-ajax/testing-your-javascript-with-jasmine/
And here's a tutorial on jasmine-node:
http://www.2ality./2011/10/jasmine.html
PS
In order to reference the code to be tested is useful to grasp how module.export
works on Node.js ... here you'll find all the info you need to get started: http://jherdman.github./2010-04-05/understanding-nodejs-require.html (broken link) http://coppieters.blogspot.be/2013/03/tutorial-explaining-module-export.html
Jasmine is what I use for my Javascript testing. It can be found here : https://github./jasmine/jasmine (UPDATED -- 2015)
I also use JSCoverage to test my code coverage. It can be found here : http://siliconforks./jscoverage/
There are several unit testing frameworks out there written for javascript.
You could try something like:
http://testcase.rubyforge/