2

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

0

3 Answers 3

2

You can install node.js with jasmine-node package to run your tests using cli:

Here's a brief intro to Jasmine:

http://net.tutsplus.com/tutorials/javascript-ajax/testing-your-javascript-with-jasmine/

And here's a tutorial on jasmine-node:

http://www.2ality.com/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.com/2010-04-05/understanding-nodejs-require.html (broken link) http://coppieters.blogspot.be/2013/03/tutorial-explaining-module-export.html

Sign up to request clarification or add additional context in comments.

Comments

2

Jasmine is what I use for my Javascript testing. It can be found here : https://github.com/jasmine/jasmine (UPDATED -- 2015)

I also use JSCoverage to test my code coverage. It can be found here : http://siliconforks.com/jscoverage/

Comments

1

There are several unit testing frameworks out there written for javascript.

You could try something like:

http://testcase.rubyforge.org/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.