addon: qunit-composite - Allow naming of test suites... #382

Closed
wants to merge 1 commit into
from
@@ -20,6 +20,6 @@ then specify the test suites to load using `QUnit.testSuites`:
QUnit.testSuites([
"test-file-1.html",
"test-file-2.html",
- "test-file-3.html"
+ { name: "Test File 3", path: "test-file-3.html" } // optionally provide a name and path
]);
-```
+```
@@ -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>
@@ -22,7 +22,7 @@
QUnit.testSuites([
"test-file-1.html",
"test-file-2.html",
-"test-file-3.html"
+{ name: "Test File 3", path: "test-file-3.html" } // optionally provide a name and path
]);
</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 );
});
},