From 795e4fd66dd9f3558d1563a4949567c485849d58 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 17 Feb 2017 20:32:40 +0800 Subject: [PATCH] test: remove WHATWG URL test data file extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Timothy Gu Reviewed-By: James M Snell --- test/fixtures/{url-tests.json => url-tests.js} | 10 ++++++++-- test/known_issues/test-url-parse-conformance.js | 2 +- test/parallel/test-whatwg-url-constructor.js | 2 +- test/parallel/test-whatwg-url-inspect.js | 4 ++-- test/parallel/test-whatwg-url-origin.js | 2 +- test/parallel/test-whatwg-url-parsing.js | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) rename test/fixtures/{url-tests.json => url-tests.js} (99%) diff --git a/test/fixtures/url-tests.json b/test/fixtures/url-tests.js similarity index 99% rename from test/fixtures/url-tests.json rename to test/fixtures/url-tests.js index fb286ed91fc..a762f8213c9 100644 --- a/test/fixtures/url-tests.json +++ b/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", - "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", diff --git a/test/known_issues/test-url-parse-conformance.js b/test/known_issues/test-url-parse-conformance.js index f7fcec821c8..62c36da87e6 100644 --- a/test/known_issues/test-url-parse-conformance.js +++ b/test/known_issues/test-url-parse-conformance.js @@ -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; diff --git a/test/parallel/test-whatwg-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js index ffcc022d314..3b567f4a943 100644 --- a/test/parallel/test-whatwg-url-constructor.js +++ b/test/parallel/test-whatwg-url-constructor.js @@ -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 */ diff --git a/test/parallel/test-whatwg-url-inspect.js b/test/parallel/test-whatwg-url-inspect.js index 4c6c8771b9f..4afbbc13102 100644 --- a/test/parallel/test-whatwg-url-inspect.js +++ b/test/parallel/test-whatwg-url-inspect.js @@ -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) { diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js index 1186a1d1844..c7126585e17 100644 --- a/test/parallel/test-whatwg-url-origin.js +++ b/test/parallel/test-whatwg-url-origin.js @@ -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 */ diff --git a/test/parallel/test-whatwg-url-parsing.js b/test/parallel/test-whatwg-url-parsing.js index 6775f79746a..e4f8306ead8 100644 --- a/test/parallel/test-whatwg-url-parsing.js +++ b/test/parallel/test-whatwg-url-parsing.js @@ -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')