Skip to content

Commit a34ac21

Browse files
gautamaroraaddaleax
authored andcommitted
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: #14355 Fixes: #12793 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent fba94d3 commit a34ac21

20 files changed

+59
-39
lines changed

doc/guides/writing-tests.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,12 @@ Some of the tests for the WHATWG URL implementation (named
263263
These imported tests will be wrapped like this:
264264

265265
```js
266-
/* eslint-disable */
267-
/* WPT Refs:
266+
/* The following tests are copied from WPT. Modifications to them should be
267+
upstreamed first. Refs:
268268
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html
269269
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
270270
*/
271+
/* eslint-disable */
271272

272273
// Test code
273274

test/fixtures/url-setter-tests.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
/* WPT Refs:
3+
/* The following tests are copied from WPT. Modifications to them should be
4+
upstreamed first. Refs:
45
https://github.com/w3c/web-platform-tests/blob/b30abaecf4/url/setters_tests.json
56
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
67
*/

test/fixtures/url-tests.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
/* WPT Refs:
3+
/* The following tests are copied from WPT. Modifications to them should be
4+
upstreamed first. Refs:
45
https://github.com/w3c/web-platform-tests/blob/8df7c9c215/url/urltestdata.json
56
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
67
*/

test/fixtures/url-toascii.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
/* WPT Refs:
3+
/* The following tests are copied from WPT. Modifications to them should be
4+
upstreamed first. Refs:
45
https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.json
56
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
67
*/

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ const request = {
1414
response: require(path.join(common.fixturesDir, 'url-tests'))
1515
};
1616

17-
/* eslint-disable */
18-
/* WPT Refs:
17+
/* The following tests are copied from WPT. Modifications to them should be
18+
upstreamed first. Refs:
1919
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-constructor.html
2020
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
2121
*/
22+
/* eslint-disable */
2223
function runURLConstructorTests() {
2324
// var setup = async_test("Loading data…")
2425
// setup.step(function() {

test/parallel/test-whatwg-url-historical.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ if (!common.hasIntl) {
88
const URL = require('url').URL;
99
const { test, assert_equals, assert_throws } = require('../common/wpt');
1010

11-
/* eslint-disable */
12-
/* WPT Refs:
11+
/* The following tests are copied from WPT. Modifications to them should be
12+
upstreamed first. Refs:
1313
https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html
1414
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1515
*/
16+
/* eslint-disable */
1617
// var objects = [
1718
// [function() { return window.location }, "location object"],
1819
// [function() { return document.createElement("a") }, "a element"],

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ const request = {
1313
response: require(path.join(common.fixturesDir, 'url-tests'))
1414
};
1515

16-
/* eslint-disable */
17-
/* WPT Refs:
16+
/* The following tests are copied from WPT. Modifications to them should be
17+
upstreamed first. Refs:
1818
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-origin.html
1919
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
2020
*/
21+
/* eslint-disable */
2122
function runURLOriginTests() {
2223
// var setup = async_test("Loading data…")
2324
// setup.step(function() {

test/parallel/test-whatwg-url-searchparams-append.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const assert = require('assert');
55
const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_equals, assert_true } = require('../common/wpt');
77

8-
/* eslint-disable */
9-
/* WPT Refs:
8+
/* The following tests are copied from WPT. Modifications to them should be
9+
upstreamed first. Refs:
1010
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-append.html
1111
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1212
*/
13+
/* eslint-disable */
1314
test(function() {
1415
var params = new URLSearchParams();
1516
params.append('a', 'b');

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ const {
88
assert_false, assert_throws, assert_array_equals
99
} = require('../common/wpt');
1010

11-
/* eslint-disable */
12-
var params; // Strict mode fix for WPT.
13-
/* WPT Refs:
11+
/* The following tests are copied from WPT. Modifications to them should be
12+
upstreamed first. Refs:
1413
https://github.com/w3c/web-platform-tests/blob/54c3502d7b/url/urlsearchparams-constructor.html
1514
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1615
*/
16+
/* eslint-disable */
17+
var params; // Strict mode fix for WPT.
1718
test(function() {
1819
var params = new URLSearchParams();
1920
assert_equals(params + '', '');

test/parallel/test-whatwg-url-searchparams-delete.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const { URL, URLSearchParams } = require('url');
66
const { test, assert_equals, assert_true, assert_false } =
77
require('../common/wpt');
88

9-
/* eslint-disable */
10-
/* WPT Refs:
9+
/* The following tests are copied from WPT. Modifications to them should be
10+
upstreamed first. Refs:
1111
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-delete.html
1212
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1313
*/
14+
/* eslint-disable */
1415
test(function() {
1516
var params = new URLSearchParams('a=b&c=d');
1617
params.delete('a');

test/parallel/test-whatwg-url-searchparams-foreach.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ const { URL, URLSearchParams } = require('url');
66
const { test, assert_array_equals, assert_unreached } =
77
require('../common/wpt');
88

9-
/* eslint-disable */
10-
var i; // Strict mode fix for WPT.
11-
/* WPT Refs:
9+
/* The following tests are copied from WPT. Modifications to them should be
10+
upstreamed first. Refs:
1211
https://github.com/w3c/web-platform-tests/blob/a8b2b1e/url/urlsearchparams-foreach.html
1312
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1413
*/
14+
/* eslint-disable */
15+
var i; // Strict mode fix for WPT.
1516
test(function() {
1617
var params = new URLSearchParams('a=1&b=2&c=3');
1718
var keys = [];

test/parallel/test-whatwg-url-searchparams-get.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const assert = require('assert');
55
const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_equals, assert_true } = require('../common/wpt');
77

8-
/* eslint-disable */
9-
/* WPT Refs:
8+
/* The following tests are copied from WPT. Modifications to them should be
9+
upstreamed first. Refs:
1010
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-get.html
1111
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1212
*/
13+
/* eslint-disable */
1314
test(function() {
1415
var params = new URLSearchParams('a=b&c=d');
1516
assert_equals(params.get('a'), 'b');

test/parallel/test-whatwg-url-searchparams-getall.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_equals, assert_true, assert_array_equals } =
77
require('../common/wpt');
88

9-
/* eslint-disable */
10-
/* WPT Refs:
9+
/* The following tests are copied from WPT. Modifications to them should be
10+
upstreamed first. Refs:
1111
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-getall.html
1212
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1313
*/
14+
/* eslint-disable */
1415
test(function() {
1516
var params = new URLSearchParams('a=b&c=d');
1617
assert_array_equals(params.getAll('a'), ['b']);

test/parallel/test-whatwg-url-searchparams-has.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const assert = require('assert');
55
const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_false, assert_true } = require('../common/wpt');
77

8-
/* eslint-disable */
9-
/* WPT Refs:
8+
/* The following tests are copied from WPT. Modifications to them should be
9+
upstreamed first. Refs:
1010
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-has.html
1111
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1212
*/
13+
/* eslint-disable */
1314
test(function() {
1415
var params = new URLSearchParams('a=b&c=d');
1516
assert_true(params.has('a'));

test/parallel/test-whatwg-url-searchparams-set.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const assert = require('assert');
55
const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_equals, assert_true } = require('../common/wpt');
77

8-
/* eslint-disable */
9-
/* WPT Refs:
8+
/* The following tests are copied from WPT. Modifications to them should be
9+
upstreamed first. Refs:
1010
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-set.html
1111
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1212
*/
13+
/* eslint-disable */
1314
test(function() {
1415
var params = new URLSearchParams('a=b&c=d');
1516
params.set('a', 'B');

test/parallel/test-whatwg-url-searchparams-sort.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ require('../common');
44
const { URL, URLSearchParams } = require('url');
55
const { test, assert_array_equals } = require('../common/wpt');
66

7-
/* eslint-disable */
8-
/* WPT Refs:
7+
/* The following tests are copied from WPT. Modifications to them should be
8+
upstreamed first. Refs:
99
https://github.com/w3c/web-platform-tests/blob/5903e00e77e85f8bcb21c73d1d7819fcd04763bd/url/urlsearchparams-sort.html
1010
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1111
*/
12+
/* eslint-disable */
1213
[
1314
{
1415
"input": "z=b&a=b&z=a&a=a",

test/parallel/test-whatwg-url-searchparams-stringifier.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const assert = require('assert');
55
const URLSearchParams = require('url').URLSearchParams;
66
const { test, assert_equals } = require('../common/wpt');
77

8-
/* eslint-disable */
9-
/* WPT Refs:
8+
/* The following tests are copied from WPT. Modifications to them should be
9+
upstreamed first. Refs:
1010
https://github.com/w3c/web-platform-tests/blob/8791bed/url/urlsearchparams-stringifier.html
1111
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1212
*/
13+
/* eslint-disable */
1314
test(function() {
1415
var params = new URLSearchParams();
1516
params.append('a', 'b c');

test/parallel/test-whatwg-url-setters.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ const request = {
1717
response: require(path.join(common.fixturesDir, 'url-setter-tests'))
1818
};
1919

20-
/* eslint-disable */
21-
/* WPT Refs:
20+
/* The following tests are copied from WPT. Modifications to them should be
21+
upstreamed first. Refs:
2222
https://github.com/w3c/web-platform-tests/blob/8791bed/url/url-setters.html
2323
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
2424
*/
25+
/* eslint-disable */
2526
function startURLSettersTests() {
2627
// var setup = async_test("Loading data…")
2728
// setup.step(function() {

test/parallel/test-whatwg-url-toascii.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ const request = {
1313
response: require(path.join(common.fixturesDir, 'url-toascii'))
1414
};
1515

16-
/* eslint-disable */
17-
/* WPT Refs:
16+
/* The following tests are copied from WPT. Modifications to them should be
17+
upstreamed first. Refs:
1818
https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.window.js
1919
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
2020
*/
21+
/* eslint-disable */
2122
// async_test(t => {
2223
// const request = new XMLHttpRequest()
2324
// request.open("GET", "toascii.json")

test/parallel/test-whatwg-url-tojson.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ require('../common');
44
const URL = require('url').URL;
55
const { test, assert_equals } = require('../common/wpt');
66

7-
/* eslint-disable */
8-
/* WPT Refs:
7+
/* The following tests are copied from WPT. Modifications to them should be
8+
upstreamed first. Refs:
99
https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html
1010
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
1111
*/
12+
/* eslint-disable */
1213
test(() => {
1314
const a = new URL("https://example.com/")
1415
assert_equals(JSON.stringify(a), "\"https://example.com/\"")

0 commit comments

Comments
 (0)