[dw-free] Framework for JS unit tests
[commit: http://hg.dwscoalition.org/dw-free/rev/40ecd02c514c]
http://bugs.dwscoalition.org/show_bug.cgi?id=3524
Only do automatic filtering if we provide a library (/jquery, /old) in the
URL. This lets us see all tests (even if they then just fail!) in the bare
form of the test URL.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3524
Only do automatic filtering if we provide a library (/jquery, /old) in the
URL. This lets us see all tests (even if they then just fail!) in the bare
form of the test URL.
Patch by
Files modified:
- views/dev/tests.tt
- views/dev/tests/sample.js
--------------------------------------------------------------------------------
diff -r f887a5ae273c -r 40ecd02c514c views/dev/tests.tt
--- a/views/dev/tests.tt Tue Feb 22 23:54:25 2011 +0800
+++ b/views/dev/tests.tt Wed Feb 23 14:30:21 2011 +0800
@@ -28,9 +28,8 @@ the same terms as Perl itself. For a co
[%- sections.head = BLOCK %]
<!-- test definition -->
<script type="text/javascript">
-if ( ! location.search ) {
- var lib = "[% testlib %]";
-
+var lib = "[% testlib %]";
+if ( lib && ! location.search ) {
QUnit.config.filters = [ "*" ];
if ( lib ) {
QUnit.config.filters.push( lib );
diff -r f887a5ae273c -r 40ecd02c514c views/dev/tests/sample.js
--- a/views/dev/tests/sample.js Tue Feb 22 23:54:25 2011 +0800
+++ b/views/dev/tests/sample.js Wed Feb 23 14:30:21 2011 +0800
@@ -31,9 +31,9 @@ old: stc/old-only-file.js
also filter to specific matching test names in the same way.
- If you don't filter to a specific module, then the tests will automatically
- run the module matching your current desired library (if provided), and all
- modules whose name begins with a "*".
+ If you specify a library but don't filter to a module (using URL arguments),
+ the tests will automatically run the module matching the library as well as
+ all modules whose name begins with a "*".
=============================================================================*/
module( "jquery" );
--------------------------------------------------------------------------------
