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:
parent
69fdb47e20
commit
9e4ab6c206
@ -263,11 +263,12 @@ Some of the tests for the WHATWG URL implementation (named
|
||||
These imported tests will be wrapped like this:
|
||||
|
||||
```js
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-stringifier.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
|
||||
// Test code
|
||||
|
||||
|
3
test/fixtures/url-setter-tests.js
vendored
3
test/fixtures/url-setter-tests.js
vendored
@ -1,6 +1,7 @@
|
||||
'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
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
|
3
test/fixtures/url-tests.js
vendored
3
test/fixtures/url-tests.js
vendored
@ -1,6 +1,7 @@
|
||||
'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
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
|
3
test/fixtures/url-toascii.js
vendored
3
test/fixtures/url-toascii.js
vendored
@ -1,6 +1,7 @@
|
||||
'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
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
|
@ -14,11 +14,12 @@ const request = {
|
||||
response: require(path.join(common.fixturesDir, 'url-tests'))
|
||||
};
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/url-constructor.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
function runURLConstructorTests() {
|
||||
// var setup = async_test("Loading data…")
|
||||
// setup.step(function() {
|
||||
|
@ -8,11 +8,12 @@ if (!common.hasIntl) {
|
||||
const URL = require('url').URL;
|
||||
const { test, assert_equals, assert_throws } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/historical.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
// var objects = [
|
||||
// [function() { return window.location }, "location object"],
|
||||
// [function() { return document.createElement("a") }, "a element"],
|
||||
|
@ -13,11 +13,12 @@ const request = {
|
||||
response: require(path.join(common.fixturesDir, 'url-tests'))
|
||||
};
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/url-origin.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
function runURLOriginTests() {
|
||||
// var setup = async_test("Loading data…")
|
||||
// setup.step(function() {
|
||||
|
@ -5,11 +5,12 @@ const assert = require('assert');
|
||||
const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_equals, assert_true } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-append.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams();
|
||||
params.append('a', 'b');
|
||||
|
@ -8,12 +8,13 @@ const {
|
||||
assert_false, assert_throws, assert_array_equals
|
||||
} = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
var params; // Strict mode fix for WPT.
|
||||
/* 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/54c3502d7b/url/urlsearchparams-constructor.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
var params; // Strict mode fix for WPT.
|
||||
test(function() {
|
||||
var params = new URLSearchParams();
|
||||
assert_equals(params + '', '');
|
||||
|
@ -6,11 +6,12 @@ const { URL, URLSearchParams } = require('url');
|
||||
const { test, assert_equals, assert_true, assert_false } =
|
||||
require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-delete.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=b&c=d');
|
||||
params.delete('a');
|
||||
|
@ -6,12 +6,13 @@ const { URL, URLSearchParams } = require('url');
|
||||
const { test, assert_array_equals, assert_unreached } =
|
||||
require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
var i; // Strict mode fix for WPT.
|
||||
/* 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/a8b2b1e/url/urlsearchparams-foreach.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
var i; // Strict mode fix for WPT.
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=1&b=2&c=3');
|
||||
var keys = [];
|
||||
|
@ -5,11 +5,12 @@ const assert = require('assert');
|
||||
const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_equals, assert_true } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-get.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=b&c=d');
|
||||
assert_equals(params.get('a'), 'b');
|
||||
|
@ -6,11 +6,12 @@ const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_equals, assert_true, assert_array_equals } =
|
||||
require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-getall.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=b&c=d');
|
||||
assert_array_equals(params.getAll('a'), ['b']);
|
||||
|
@ -5,11 +5,12 @@ const assert = require('assert');
|
||||
const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_false, assert_true } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-has.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=b&c=d');
|
||||
assert_true(params.has('a'));
|
||||
|
@ -5,11 +5,12 @@ const assert = require('assert');
|
||||
const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_equals, assert_true } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-set.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams('a=b&c=d');
|
||||
params.set('a', 'B');
|
||||
|
@ -4,11 +4,12 @@ require('../common');
|
||||
const { URL, URLSearchParams } = require('url');
|
||||
const { test, assert_array_equals } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/5903e00e77e85f8bcb21c73d1d7819fcd04763bd/url/urlsearchparams-sort.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
[
|
||||
{
|
||||
"input": "z=b&a=b&z=a&a=a",
|
||||
|
@ -5,11 +5,12 @@ const assert = require('assert');
|
||||
const URLSearchParams = require('url').URLSearchParams;
|
||||
const { test, assert_equals } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/urlsearchparams-stringifier.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(function() {
|
||||
var params = new URLSearchParams();
|
||||
params.append('a', 'b c');
|
||||
|
@ -17,11 +17,12 @@ const request = {
|
||||
response: require(path.join(common.fixturesDir, 'url-setter-tests'))
|
||||
};
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/8791bed/url/url-setters.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
function startURLSettersTests() {
|
||||
// var setup = async_test("Loading data…")
|
||||
// setup.step(function() {
|
||||
|
@ -13,11 +13,12 @@ const request = {
|
||||
response: require(path.join(common.fixturesDir, 'url-toascii'))
|
||||
};
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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.window.js
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
// async_test(t => {
|
||||
// const request = new XMLHttpRequest()
|
||||
// request.open("GET", "toascii.json")
|
||||
|
@ -4,11 +4,12 @@ require('../common');
|
||||
const URL = require('url').URL;
|
||||
const { test, assert_equals } = require('../common/wpt');
|
||||
|
||||
/* eslint-disable */
|
||||
/* 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/02585db/url/url-tojson.html
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
/* eslint-disable */
|
||||
test(() => {
|
||||
const a = new URL("https://example.com/")
|
||||
assert_equals(JSON.stringify(a), "\"https://example.com/\"")
|
||||
|
Loading…
x
Reference in New Issue
Block a user