Skip to content

Commit

Permalink
Change web platform test structure a bit
Browse files Browse the repository at this point in the history
- Move w3c/domparsing to misc/domparsing; the intent was never to segregate specs by standards organization
- Rename w3c/ to web-platform-tests/ for accuracy
- Update web-platform-tests/index.js to be a bit DRYer, which should hopefully ease updating
- Update to latest web-platform-tests revision
  • Loading branch information
domenic committed Sep 27, 2015
1 parent 2184995 commit c2d1525
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Expand Up @@ -34,7 +34,7 @@ test/level1
test/level2
test/level3
test/sizzle
test/w3c/tests
test/web-platform-tests/tests
test/window/files
test/window/frame.js
test/window/script.js
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
@@ -1,3 +1,3 @@
[submodule "test/w3c/tests"]
path = test/w3c/tests
[submodule "test/web-platform-tests/tests"]
path = test/web-platform-tests/tests
url = https://github.com/w3c/web-platform-tests.git
2 changes: 1 addition & 1 deletion .jscsrc
Expand Up @@ -57,7 +57,7 @@
"test/level2",
"test/level3",
"test/sizzle",
"test/w3c/tests",
"test/web-platform-tests/tests",
"test/window/files",
"test/window/frame.js",
"test/window/script.js",
Expand Down
2 changes: 1 addition & 1 deletion Contributing.md
Expand Up @@ -66,7 +66,7 @@ So e.g. use `npm test -- -s console` to run the console-related tests.

### Writing or importing tests

To import a test from w3c/web-platform-tests, add the appropriate line to `test/w3c/index.js`. This framework is still in its early days, so feel free to open an issue if it's not working quite like you expect.
To import a test from w3c/web-platform-tests, add the appropriate line to `test/web-platform-tests/index.js`. This framework is still in its early days, so feel free to open an issue if it's not working quite like you expect.

If you're writing a bunch of new tests for a feature, and those tests don't exist in w3c/web-platform-tests, you can do one of two things. The most noble course of action is to submit a pull request to web-platform-tests, get it accepted and merged, then update jsdom to run those tests. That way, all existing browsers will run the test too, improving interoperability for everyone!

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions test/runner
Expand Up @@ -97,8 +97,8 @@ var files = [
"jsonp/jsonp.js",
"browser/css.js",
"browser/index.js",
"w3c/index.js",
"w3c/domparsing.js"
"web-platform-tests/index.js",
"misc/domparsing.js"
];

if (fileFilter.length > 0) {
Expand Down
60 changes: 0 additions & 60 deletions test/w3c/index.js

This file was deleted.

1 change: 0 additions & 1 deletion test/w3c/tests
Submodule tests deleted from f3aabb
62 changes: 62 additions & 0 deletions test/web-platform-tests/index.js
@@ -0,0 +1,62 @@
"use strict";
const runWebPlatformTest = require("./run-web-platform-test")(exports);

[
"dom/nodes/CharacterData-appendData.html",
"dom/nodes/CharacterData-deleteData.html",
"dom/nodes/CharacterData-insertData.html",
"dom/nodes/CharacterData-replaceData.html",
"dom/nodes/Document-contentType/contentType/createHTMLDocument.html",
"dom/nodes/Document-createComment.html",
"dom/nodes/Document-createProcessingInstruction.html",
"dom/nodes/Document-createProcessingInstruction.xhtml",
"dom/nodes/Document-createTextNode.html",
"dom/nodes/Document-implementation.html",
"dom/nodes/DocumentType-literal.html",
"dom/nodes/DocumentType-literal.xhtml",
"dom/nodes/DOMImplementation-createDocumentType.html",
"dom/nodes/DOMImplementation-createHTMLDocument.html",
"dom/nodes/DOMImplementation-hasFeature.html",
"dom/nodes/Element-classlist.html",
"dom/nodes/Element-getElementsByClassName.html",
"dom/nodes/getElementsByClassName-01.htm",
"dom/nodes/getElementsByClassName-02.htm",
"dom/nodes/getElementsByClassName-03.htm",
"dom/nodes/getElementsByClassName-04.htm",
"dom/nodes/getElementsByClassName-05.htm",
"dom/nodes/getElementsByClassName-06.htm",
"dom/nodes/getElementsByClassName-07.htm",
"dom/nodes/getElementsByClassName-08.htm",
"dom/nodes/getElementsByClassName-09.htm",
// "dom/nodes/getElementsByClassName-10.xml", // XML class attribute and localName and namespaces don't work well
// "dom/nodes/getElementsByClassName-11.xml", // XML class attribute and localName and namespaces don't work well
"dom/nodes/getElementsByClassName-12.htm",
"dom/nodes/getElementsByClassName-13.htm",
"dom/nodes/getElementsByClassName-14.htm",
"dom/nodes/getElementsByClassName-15.htm",
"dom/nodes/getElementsByClassName-16.htm",
"dom/nodes/getElementsByClassName-17.htm",
"dom/nodes/getElementsByClassName-18.htm",
"dom/nodes/getElementsByClassName-19.htm",
"dom/nodes/getElementsByClassName-20.htm",
"dom/nodes/getElementsByClassName-21.htm",
"dom/nodes/getElementsByClassName-22.htm",
"dom/nodes/getElementsByClassName-23.htm",
"dom/nodes/getElementsByClassName-24.htm",
"dom/nodes/getElementsByClassName-25.htm",
"dom/nodes/getElementsByClassName-26.htm",
"dom/nodes/getElementsByClassName-27.htm",
"dom/nodes/getElementsByClassName-28.htm",
"dom/nodes/getElementsByClassName-29.htm",
"dom/nodes/getElementsByClassName-30.htm",
"dom/nodes/getElementsByClassName-31.htm",
"dom/nodes/Node-baseURI.html",
"dom/nodes/Node-cloneNode.html",
"dom/traversal/NodeFilter-constants.html",
"dom/traversal/NodeIterator.html",
"html/dom/elements/global-attributes/classlist-nonstring.html",
"html/infrastructure/urls/terminology-0/document-base-url.html",
"html/syntax/serializing-html-fragments/outerHTML.html",
"html/webappapis/atob/base64.html"
]
.forEach(runWebPlatformTest);
File renamed without changes.
1 change: 1 addition & 0 deletions test/web-platform-tests/tests
Submodule tests added at 86be09
6 changes: 3 additions & 3 deletions test/worker-runner.js
Expand Up @@ -74,8 +74,8 @@ self.onmessage = function (e) {
"jsonp/jsonp": require("../test/jsonp/jsonp"), // 0/1
"browser/css": require("../test/browser/css"), // ok
"browser/index": require("../test/browser/index"), // ok
//"w3c/index.js": require("../test/w3c/index"), // cannot browserify
"w3c/domparsing.js": require("../test/w3c/domparsing")
//"web-platform-tests/index.js": require("../test/web-platform-tests/index"), // cannot browserify
"misc/domparsing.js": require("../test/misc/domparsing")
};

var modulesToRun = {};
Expand Down Expand Up @@ -122,7 +122,7 @@ self.onmessage = function (e) {
"browser/css",
"browser/index",

"w3c/domparsing.js"
"misc/domparsing.js"
];

if (options.tests) {
Expand Down

0 comments on commit c2d1525

Please sign in to comment.