Talk:AMO:Developers/JavaScriptTesting

From MozillaWiki
Jump to: navigation, search

Is optimizing the JavaScriptTesting framework for testing Ajax Widgets too complicated?

I'd argue we should optimize the framework for a much simpler set of tests, like unit tests and integration tests that use the DOM. Testing widgets that use Ajax to talk to a server is a much nastier test case, This more advanced case can be solved with Mocks or Selenium driven browsers... etc. These Ajax widget tests will run more slowly than pure unit tests. We may want to treat them as a different class of automated test. Our baseline use of QUnit or another unit testing framework should make it easy to test basic JS code. Aking 14:32, 15 November 2010 (PST)

re: testing Ajax

Agreed! I really don't think any test should make an actual Ajax request because that would introduce the dependency of a server and all of a sudden we would be testing the full stack. Selenium is better for that and QA is already working with the full stack. I do, however, feel there are diminishing returns when testing small, isolated units of JavaScript, especially with the patterns that are common to jQuery. The bulk of functionality in AMO is somewhere in the realm of DOM <-> behavior <-> server data. So when I wrote Ajax I meant mock Ajax, as in no server. This keeps the tests running fast yet puts them at a mid tier integration level that will produce helpful feedback. --Kumar303 08:25, 16 November 2010 (PST)

nodeunit

+1 for being able to use the require statement. Aking 10:28, 18 November 2010 (PST)