Permalink
Browse files

Composite Add-on: Test suites can be named by including an obj with n…

…ame & path props within array param for .testSuites()
  • Loading branch information...
1 parent 8676feb commit 9be564e93f5bbfaded50958c7f7efd7de8067510 @busticated busticated committed with jzaefferer Dec 20, 2012
@@ -20,6 +20,7 @@ then specify the test suites to load using `QUnit.testSuites`:
QUnit.testSuites([
"test-file-1.html",
"test-file-2.html",
- "test-file-3.html"
+ // optionally provide a name and path
+ { name: "Test File 3", path: "test-file-3.html" }
]);
-```
+```
@@ -12,7 +12,7 @@
"../../test/index.html",
"../canvas/canvas.html",
"../close-enough/close-enough.html",
- "../step/step.html"
+ { name: "step tests", path: "../step/step.html" }
]);
</script>
</head>
@@ -20,9 +20,10 @@
passed an array of test files to run as follows:</p>
<pre>
QUnit.testSuites([
-"test-file-1.html",
-"test-file-2.html",
-"test-file-3.html"
+ "test-file-1.html",
+ "test-file-2.html",
+ // optionally provide a name and path
+ { name: "Test File 3", path: "test-file-3.html" }
]);
</pre>
<h4>Tests</h4>
@@ -16,8 +16,15 @@ QUnit.extend( QUnit, {
},
runSuite: function( suite ) {
+ var path = suite;
+
+ if ( QUnit.is( 'object', suite ) ) {
+ path = suite.path;
+ suite = suite.name;
+ }
+
asyncTest( suite, function() {
- QUnit.iframe.setAttribute( "src", suite );
+ QUnit.iframe.setAttribute( "src", path );
});
},

3 comments on commit 9be564e

@jzaefferer
Member

@busticated I'm going through authors, checking for CLA signing. I should have asked for that before merging, so could you now sign our CLA? http://contribute.jquery.org/CLA/

Can you also provide your name here (or email me at joern.zaefferer@jquery.com)?

Thanks.

@busticated

No problem at all. Done! Sent you an email as well.

@jzaefferer
Member

Thanks!

Please sign in to comment.