Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript unit testing in eclipse

I am doing a firefox extension using eclipse and need to know how I can do unit testing for that project.

like image 224
Sanjeewani Avatar asked Dec 28 '09 11:12

Sanjeewani


People also ask

Can JavaScript be unit tested?

JavaScript Unit Testing is a method where JavaScript test code is written for a web page or web application module. It is then combined with HTML as an inline event handler and executed in the browser to test if all functionalities are working as desired. These unit tests are then organized in the test suite.

What is a test runner JavaScript?

As the name suggests, Test Runner is a tool that is used to run or execute tests and export results. It is a library that selects the source code directory and picks the test files to run them for verifying bugs and errors.


2 Answers

I think you can use Jasmine Framework for that.

like image 196
Gihan De Silva Avatar answered Sep 21 '22 01:09

Gihan De Silva


I've been using JSTestDriver, http://code.google.com/p/js-test-driver, and it is an excellent framework. Lightning fast testing, test on save, and other cool features.

Initial setup is a bit complicated, but it's certainly worth it.

like image 26
Itay Maman Avatar answered Sep 20 '22 01:09

Itay Maman