Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

3 participants

@busticated

Hey there -

First, thanks for qunit-composite - great li'l helper! We made a small tweak to allow for naming of test suites - it's really just to make the GUI a bit more friendly when your test paths are kind of crazy (which ours are).

in short, you can do:

QUnit.testSuites([
    "test-file-1.html",
    "test-file-2.html",
   { name: "Test File 3", path: "test-file-3.html" } // optionally provide a name and path
]);

Anyway, hope it helps!
-matt

@JamesMGreene
Collaborator

This seems helpful. We have some crazy suite paths in our composites, too.

@jzaefferer
Owner

Thanks, landed in 9be564e

@jzaefferer jzaefferer closed this
@jzaefferer jzaefferer was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2012
  1. @busticated

    test suites can be named by including an obj w/ name & path props wit…

    busticated authored
    …hin array param for .testSuites()
This page is out of date. Refresh to see the latest.
View
4 addons/composite/README.md
@@ -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
]);
-```
+```
View
2  addons/composite/composite-demo-test.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>
View
2  addons/composite/index.html
@@ -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>
View
9 addons/composite/qunit-composite.js
@@ -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 );
});
},
Something went wrong with that request. Please try again.