Browse Source

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>
v6
Gautam Arora 8 years ago
committed by Refael Ackermann
parent
commit
9e4ab6c206
No known key found for this signature in database GPG Key ID: CD704BD80FDDDB64
  1. 5
      doc/guides/writing-tests.md
  2. 3
      test/fixtures/url-setter-tests.js
  3. 3
      test/fixtures/url-tests.js
  4. 3
      test/fixtures/url-toascii.js
  5. 5
      test/parallel/test-whatwg-url-constructor.js
  6. 5
      test/parallel/test-whatwg-url-historical.js
  7. 5
      test/parallel/test-whatwg-url-origin.js
  8. 5
      test/parallel/test-whatwg-url-searchparams-append.js
  9. 7
      test/parallel/test-whatwg-url-searchparams-constructor.js
  10. 5
      test/parallel/test-whatwg-url-searchparams-delete.js
  11. 7
      test/parallel/test-whatwg-url-searchparams-foreach.js
  12. 5
      test/parallel/test-whatwg-url-searchparams-get.js
  13. 5
      test/parallel/test-whatwg-url-searchparams-getall.js
  14. 5
      test/parallel/test-whatwg-url-searchparams-has.js
  15. 5
      test/parallel/test-whatwg-url-searchparams-set.js
  16. 5
      test/parallel/test-whatwg-url-searchparams-sort.js
  17. 5
      test/parallel/test-whatwg-url-searchparams-stringifier.js
  18. 5
      test/parallel/test-whatwg-url-setters.js
  19. 5
      test/parallel/test-whatwg-url-toascii.js
  20. 5
      test/parallel/test-whatwg-url-tojson.js

5
doc/guides/writing-tests.md

@ -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

@ -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

@ -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

@ -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
*/

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

@ -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() {

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

@ -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"],

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

@ -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
test/parallel/test-whatwg-url-searchparams-append.js

@ -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');

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

@ -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 + '', '');

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

@ -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');

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

@ -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
test/parallel/test-whatwg-url-searchparams-get.js

@ -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');

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

@ -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
test/parallel/test-whatwg-url-searchparams-has.js

@ -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
test/parallel/test-whatwg-url-searchparams-set.js

@ -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');

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

@ -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
test/parallel/test-whatwg-url-searchparams-stringifier.js

@ -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');

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

@ -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() {

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

@ -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")

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

@ -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…
Cancel
Save