[jQuery] Testsuite 2.0
[jQuery] Testsuite 2.0
Good news everyone!
Just finished a heavy refactoring on the jQuery testsuite. It features a
quite heavy change on writing and running tests: Inline tests are
history, all tests can now be placed inside their own files or within
script tags. The jQuery src directory contains now additonal files
ending with "Test.js", that contain all tests for the jQuery core. The
two plugins that currently have their own testsuite in the repository,
form and methods, were updated, too.
Why this change? It is now possible to write and modify tests and run
them instantly, without running any build files. This makes the process
of writing, running and testing tests way more easier and attractive.
Anothe very important new feature: It is now possible to call
expect(Number) at the start of every tests. The number specifies the
amount of expected assertions. Tests that fail completely won't slip
through with "0 failed out of 0", instead report "Expected 1 assertions,
but 0 were run". This makes the testsuite much more reliable. For
example, the test that should have covered the problem mentioned in bug
#407 (http://jquery.com/dev/bugs/bug/407/) now fails correctly in the
testsuite.
I recommend for every plugin writer to take a look at the offcial
testsuite and those of the form and methods plugin, and consider writing
tests for you own plugins.
It's quite likely that I have overseen something while converting the
tests, please report or fix any problems you spot.
Have fun!
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/