Browse Source

test: remove WHATWG URL test data file extension

Make url-tests a js file so we can comment out
incompatible tests

PR-URL: https://github.com/nodejs/node/pull/11439
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Joyee Cheung 8 years ago
parent
commit
795e4fd66d
  1. 10
      test/fixtures/url-tests.js
  2. 2
      test/known_issues/test-url-parse-conformance.js
  3. 2
      test/parallel/test-whatwg-url-constructor.js
  4. 4
      test/parallel/test-whatwg-url-inspect.js
  5. 2
      test/parallel/test-whatwg-url-origin.js
  6. 2
      test/parallel/test-whatwg-url-parsing.js

10
test/fixtures/url-tests.json → test/fixtures/url-tests.js

@ -1,7 +1,13 @@
'use strict';
/* WPT Refs:
https://github.com/w3c/web-platform-tests/blob/master/url/urltestdata.json
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/
module.exports =
[ [
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js", "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
"License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html",
"Source: https://github.com/w3c/web-platform-tests/tree/master/url",
{ {
"input": "http://example\t.\norg", "input": "http://example\t.\norg",
"base": "http://example.org/foo/bar", "base": "http://example.org/foo/bar",

2
test/known_issues/test-url-parse-conformance.js

@ -7,7 +7,7 @@ const url = require('url');
const assert = require('assert'); const assert = require('assert');
const path = require('path'); const path = require('path');
const tests = require(path.join(common.fixturesDir, 'url-tests.json')); const tests = require(path.join(common.fixturesDir, 'url-tests'));
let failed = 0; let failed = 0;
let attempted = 0; let attempted = 0;

2
test/parallel/test-whatwg-url-constructor.js

@ -11,7 +11,7 @@ if (!common.hasIntl) {
} }
const request = { const request = {
response: require(path.join(common.fixturesDir, 'url-tests.json')) response: require(path.join(common.fixturesDir, 'url-tests'))
}; };
/* eslint-disable */ /* eslint-disable */

4
test/parallel/test-whatwg-url-inspect.js

@ -13,9 +13,9 @@ if (!common.hasIntl) {
} }
// Tests below are not from WPT. // Tests below are not from WPT.
const tests = require(path.join(common.fixturesDir, 'url-tests.json')); const tests = require(path.join(common.fixturesDir, 'url-tests'));
const additional_tests = require( const additional_tests = require(
path.join(common.fixturesDir, 'url-tests-additional.js')); path.join(common.fixturesDir, 'url-tests-additional'));
const allTests = additional_tests.slice(); const allTests = additional_tests.slice();
for (const test of tests) { for (const test of tests) {

2
test/parallel/test-whatwg-url-origin.js

@ -11,7 +11,7 @@ if (!common.hasIntl) {
} }
const request = { const request = {
response: require(path.join(common.fixturesDir, 'url-tests.json')) response: require(path.join(common.fixturesDir, 'url-tests'))
}; };
/* eslint-disable */ /* eslint-disable */

2
test/parallel/test-whatwg-url-parsing.js

@ -12,7 +12,7 @@ if (!common.hasIntl) {
} }
// Tests below are not from WPT. // Tests below are not from WPT.
const tests = require(path.join(common.fixturesDir, 'url-tests.json')); const tests = require(path.join(common.fixturesDir, 'url-tests'));
for (const test of tests) { for (const test of tests) {
if (typeof test === 'string') if (typeof test === 'string')

Loading…
Cancel
Save