test: add comments for whatwg-url tests

Added comments to whatwg-url tests that they should not be changed until
modifications are merged upstream as per "Web Platform Tests" guidelines

PR-URL: https://github.com/nodejs/node/pull/14355
Fixes: https://github.com/nodejs/node/issues/12793
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Gautam Arora 2017-07-18 20:41:00 -04:00 committed by Refael Ackermann
parent 69fdb47e20
commit 9e4ab6c206
No known key found for this signature in database
GPG Key ID: CD704BD80FDDDB64
20 changed files with 59 additions and 39 deletions

View File

@ -263,11 +263,12 @@ Some of the tests for the WHATWG URL implementation (named
These imported tests will be wrapped like this: These imported tests will be wrapped like this:
```js ```js
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
// Test code // Test code

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
/* WPT Refs: /* The following tests are copied from WPT. Modifications to them should be
upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/b30abaecf4/url/setters_tests.json https://github.com/w3c/web-platform-tests/blob/b30abaecf4/url/setters_tests.json
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
/* WPT Refs: /* The following tests are copied from WPT. Modifications to them should be
upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8df7c9c215/url/urltestdata.json https://github.com/w3c/web-platform-tests/blob/8df7c9c215/url/urltestdata.json
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
/* WPT Refs: /* The following tests are copied from WPT. Modifications to them should be
upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.json https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.json
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */

View File

@ -14,11 +14,12 @@ const request = {
response: require(path.join(common.fixturesDir, 'url-tests')) response: require(path.join(common.fixturesDir, 'url-tests'))
}; };
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-constructor.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-constructor.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
function runURLConstructorTests() { function runURLConstructorTests() {
// var setup = async_test("Loading data…") // var setup = async_test("Loading data…")
// setup.step(function() { // setup.step(function() {

View File

@ -8,11 +8,12 @@ if (!common.hasIntl) {
const URL = require('url').URL; const URL = require('url').URL;
const { test, assert_equals, assert_throws } = require('../common/wpt'); const { test, assert_equals, assert_throws } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
// var objects = [ // var objects = [
// [function() { return window.location }, "location object"], // [function() { return window.location }, "location object"],
// [function() { return document.createElement("a") }, "a element"], // [function() { return document.createElement("a") }, "a element"],

View File

@ -13,11 +13,12 @@ const request = {
response: require(path.join(common.fixturesDir, 'url-tests')) response: require(path.join(common.fixturesDir, 'url-tests'))
}; };
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-origin.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-origin.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
function runURLOriginTests() { function runURLOriginTests() {
// var setup = async_test("Loading data…") // var setup = async_test("Loading data…")
// setup.step(function() { // setup.step(function() {

View File

@ -5,11 +5,12 @@ const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams; const URLSearchParams = require('url').URLSearchParams;
const { test, assert_equals, assert_true } = require('../common/wpt'); const { test, assert_equals, assert_true } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-append.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-append.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams(); var params = new URLSearchParams();
params.append('a', 'b'); params.append('a', 'b');

View File

@ -8,12 +8,13 @@ const {
assert_false, assert_throws, assert_array_equals assert_false, assert_throws, assert_array_equals
} = require('../common/wpt'); } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
var params; // Strict mode fix for WPT. upstreamed first. Refs:
/* WPT Refs:
https://github.com/w3c/web-platform-tests/blob/54c3502d7b/url/urlsearchparams-constructor.html https://github.com/w3c/web-platform-tests/blob/54c3502d7b/url/urlsearchparams-constructor.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
var params; // Strict mode fix for WPT.
test(function() { test(function() {
var params = new URLSearchParams(); var params = new URLSearchParams();
assert_equals(params + '', ''); assert_equals(params + '', '');

View File

@ -6,11 +6,12 @@ const { URL, URLSearchParams } = require('url');
const { test, assert_equals, assert_true, assert_false } = const { test, assert_equals, assert_true, assert_false } =
require('../common/wpt'); require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-delete.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-delete.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams('a=b&c=d'); var params = new URLSearchParams('a=b&c=d');
params.delete('a'); params.delete('a');

View File

@ -6,12 +6,13 @@ const { URL, URLSearchParams } = require('url');
const { test, assert_array_equals, assert_unreached } = const { test, assert_array_equals, assert_unreached } =
require('../common/wpt'); require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
var i; // Strict mode fix for WPT. upstreamed first. Refs:
/* WPT Refs:
https://github.com/w3c/web-platform-tests/blob/a8b2b1e/url/urlsearchparams-foreach.html https://github.com/w3c/web-platform-tests/blob/a8b2b1e/url/urlsearchparams-foreach.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
var i; // Strict mode fix for WPT.
test(function() { test(function() {
var params = new URLSearchParams('a=1&b=2&c=3'); var params = new URLSearchParams('a=1&b=2&c=3');
var keys = []; var keys = [];

View File

@ -5,11 +5,12 @@ const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams; const URLSearchParams = require('url').URLSearchParams;
const { test, assert_equals, assert_true } = require('../common/wpt'); const { test, assert_equals, assert_true } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-get.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-get.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams('a=b&c=d'); var params = new URLSearchParams('a=b&c=d');
assert_equals(params.get('a'), 'b'); assert_equals(params.get('a'), 'b');

View File

@ -6,11 +6,12 @@ const URLSearchParams = require('url').URLSearchParams;
const { test, assert_equals, assert_true, assert_array_equals } = const { test, assert_equals, assert_true, assert_array_equals } =
require('../common/wpt'); require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-getall.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-getall.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams('a=b&c=d'); var params = new URLSearchParams('a=b&c=d');
assert_array_equals(params.getAll('a'), ['b']); assert_array_equals(params.getAll('a'), ['b']);

View File

@ -5,11 +5,12 @@ const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams; const URLSearchParams = require('url').URLSearchParams;
const { test, assert_false, assert_true } = require('../common/wpt'); const { test, assert_false, assert_true } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-has.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-has.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams('a=b&c=d'); var params = new URLSearchParams('a=b&c=d');
assert_true(params.has('a')); assert_true(params.has('a'));

View File

@ -5,11 +5,12 @@ const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams; const URLSearchParams = require('url').URLSearchParams;
const { test, assert_equals, assert_true } = require('../common/wpt'); const { test, assert_equals, assert_true } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-set.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-set.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams('a=b&c=d'); var params = new URLSearchParams('a=b&c=d');
params.set('a', 'B'); params.set('a', 'B');

View File

@ -4,11 +4,12 @@ require('../common');
const { URL, URLSearchParams } = require('url'); const { URL, URLSearchParams } = require('url');
const { test, assert_array_equals } = require('../common/wpt'); const { test, assert_array_equals } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/5903e00e77e85f8bcb21c73d1d7819fcd04763bd/url/urlsearchparams-sort.html https://github.com/w3c/web-platform-tests/blob/5903e00e77e85f8bcb21c73d1d7819fcd04763bd/url/urlsearchparams-sort.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
[ [
{ {
"input": "z=b&a=b&z=a&a=a", "input": "z=b&a=b&z=a&a=a",

View File

@ -5,11 +5,12 @@ const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams; const URLSearchParams = require('url').URLSearchParams;
const { test, assert_equals } = require('../common/wpt'); const { test, assert_equals } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(function() { test(function() {
var params = new URLSearchParams(); var params = new URLSearchParams();
params.append('a', 'b c'); params.append('a', 'b c');

View File

@ -17,11 +17,12 @@ const request = {
response: require(path.join(common.fixturesDir, 'url-setter-tests')) response: require(path.join(common.fixturesDir, 'url-setter-tests'))
}; };
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-setters.html https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-setters.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
function startURLSettersTests() { function startURLSettersTests() {
// var setup = async_test("Loading data…") // var setup = async_test("Loading data…")
// setup.step(function() { // setup.step(function() {

View File

@ -13,11 +13,12 @@ const request = {
response: require(path.join(common.fixturesDir, 'url-toascii')) response: require(path.join(common.fixturesDir, 'url-toascii'))
}; };
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.window.js https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.window.js
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
// async_test(t => { // async_test(t => {
// const request = new XMLHttpRequest() // const request = new XMLHttpRequest()
// request.open("GET", "toascii.json") // request.open("GET", "toascii.json")

View File

@ -4,11 +4,12 @@ require('../common');
const URL = require('url').URL; const URL = require('url').URL;
const { test, assert_equals } = require('../common/wpt'); const { test, assert_equals } = require('../common/wpt');
/* eslint-disable */ /* The following tests are copied from WPT. Modifications to them should be
/* WPT Refs: upstreamed first. Refs:
https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/ */
/* eslint-disable */
test(() => { test(() => {
const a = new URL("https://example.com/") const a = new URL("https://example.com/")
assert_equals(JSON.stringify(a), "\"https://example.com/\"") assert_equals(JSON.stringify(a), "\"https://example.com/\"")