AMO:Developers/JavaScriptTesting: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 14: Line 14:


=== Test Runners ===
=== Test Runners ===
* [http://docs.jquery.com/Qunit QUnit]
 
** Pros
==== [http://docs.jquery.com/Qunit QUnit] ====
*** popular framework, well supported
* Pros
*** very simple and easy to write tests with
** popular framework, well supported
*** Runs primarily in a web browser like production
** very simple and easy to write tests with
*** Can provide visual feedback if necessary (useful for development)
** Runs primarily in a web browser like production
*** uses a real DOM
** Can provide visual feedback if necessary (useful for development)
*** since tests are written in HTML, Zamboni template logic can be reused in some cases
** uses a real DOM
*** has several adapters for the command line
** since tests are written in HTML, Zamboni template logic can be reused in some cases
**** [https://github.com/kof/node-qunit/ QUnit in node.js]
** has several adapters for the command line
**** QUnit with Rhino + [https://github.com/thatcher/env-js env.js] (example in [http://pypi.python.org/pypi/NoseJS#running-javascript-tests NoseJS] and [https://github.com/eroh92/nosejs this fork])
*** [https://github.com/kof/node-qunit/ QUnit in node.js]
**** [http://code.google.com/p/js-test-driver/wiki/QUnitAdapter Qunit for JsTestDriver] (Cannot do async testing)
*** QUnit with Rhino + [https://github.com/thatcher/env-js env.js] (example in [http://pypi.python.org/pypi/NoseJS#running-javascript-tests NoseJS] and [https://github.com/eroh92/nosejs this fork])
** Cons
*** [http://code.google.com/p/js-test-driver/wiki/QUnitAdapter Qunit for JsTestDriver] (Cannot do async testing)
*** Might be tricky to get working for CI.  Could load a single webpage in a web browser VM though and use builtin hooks to get test results
* Cons
*** All user events need to be simulated by triggering the event or otherwise.
** Might be tricky to get working for CI.  Could load a single webpage in a web browser VM though and use builtin hooks to get test results
*** does not fit seamlessly into the current test suite (but maybe with NoseJS?)
** All user events need to be simulated by triggering the event or otherwise.
** does not fit seamlessly into the current test suite (but maybe with NoseJS?)


=== Mock Objects ===
=== Mock Objects ===
Confirmed users
324

edits

Navigation menu