Skip to content

Commit

Permalink
test: remove WHATWG URL test data file extension
Browse files Browse the repository at this point in the history
Make url-tests a js file so we can comment out
incompatible tests

PR-URL: #11439
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung authored and italoacasas committed Feb 25, 2017

Unverified

This user has not yet uploaded their public signing key.
1 parent 4e32770 commit 4109e0e
Showing 6 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions test/fixtures/url-tests.json → test/fixtures/url-tests.js
Original file line number Diff line number Diff line change
@@ -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",
"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",
"base": "http://example.org/foo/bar",
2 changes: 1 addition & 1 deletion test/known_issues/test-url-parse-conformance.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ const url = require('url');
const assert = require('assert');
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 attempted = 0;
2 changes: 1 addition & 1 deletion test/parallel/test-whatwg-url-constructor.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ if (!common.hasIntl) {
}

const request = {
response: require(path.join(common.fixturesDir, 'url-tests.json'))
response: require(path.join(common.fixturesDir, 'url-tests'))
};

/* eslint-disable */
4 changes: 2 additions & 2 deletions test/parallel/test-whatwg-url-inspect.js
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ if (!common.hasIntl) {
}

// 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(
path.join(common.fixturesDir, 'url-tests-additional.js'));
path.join(common.fixturesDir, 'url-tests-additional'));

const allTests = additional_tests.slice();
for (const test of tests) {
2 changes: 1 addition & 1 deletion test/parallel/test-whatwg-url-origin.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ if (!common.hasIntl) {
}

const request = {
response: require(path.join(common.fixturesDir, 'url-tests.json'))
response: require(path.join(common.fixturesDir, 'url-tests'))
};

/* eslint-disable */
2 changes: 1 addition & 1 deletion test/parallel/test-whatwg-url-parsing.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ if (!common.hasIntl) {
}

// 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) {
if (typeof test === 'string')

0 comments on commit 4109e0e

Please sign in to comment.