Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add comments for whatwg-url tests #14355

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 guidelines for
[Web Platform Tests](https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#web-platform-tests)

Fixes: #12793
  • Loading branch information
gautamarora committed Jul 19, 2017
commit cb3de78d7dac7b4de84889cbe8051bda3f789223
3 changes: 2 additions & 1 deletion doc/guides/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please keep the lines under 80 chars? Not sure why the linter didn't catch that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly make the change, the recommendation for that particular comment is as per discussion here cc @joyeecheung for feedback as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ignoreComments in max-len is true by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, i could also do something like this:

/* eslint-disable */
/* 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
*/

making the changes now.

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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/url-setter-tests.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/url-tests.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/url-toascii.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const request = {
};

/* eslint-disable */
/* WPT Refs:
/* The following tests are copied from WPT, modifications to them should be upstreamed first.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this PR only changes 16 files, but looking in test/parallel/ I see 26 with the test-whatwg prefix:

➜  parallel git:(master) ✗ ❯ ls | grep test-whatwg                                                                                                                             ~/wrk/com/node/test/parallel
test-whatwg-url-constructor.js
test-whatwg-url-domainto.js
test-whatwg-url-historical.js
test-whatwg-url-inspect.js
test-whatwg-url-origin.js
test-whatwg-url-parsing.js
test-whatwg-url-properties.js
test-whatwg-url-searchparams-append.js
test-whatwg-url-searchparams-constructor.js
test-whatwg-url-searchparams-delete.js
test-whatwg-url-searchparams-entries.js
test-whatwg-url-searchparams-foreach.js
test-whatwg-url-searchparams-get.js
test-whatwg-url-searchparams-getall.js
test-whatwg-url-searchparams-has.js
test-whatwg-url-searchparams-inspect.js
test-whatwg-url-searchparams-keys.js
test-whatwg-url-searchparams-set.js
test-whatwg-url-searchparams-sort.js
test-whatwg-url-searchparams-stringifier.js
test-whatwg-url-searchparams-values.js
test-whatwg-url-searchparams.js
test-whatwg-url-setters.js
test-whatwg-url-toascii.js
test-whatwg-url-tojson.js
test-whatwg-url-tostringtag.js
➜  parallel git:(master) ✗ ❯ ls | grep test-whatwg | wc -l                                                                                                                     ~/wrk/com/node/test/parallel
      26

Copy link
Contributor

@refack refack Jul 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the delta are files that do not contain imported code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for reviewing this @gibfahn. @refack is right, the other files for test-whatwg do not contain imported code, and infact have the comment Tests below are not from WPT.

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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-historical.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-origin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const request = {
};

/* 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-append.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const {

/* 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-foreach.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const { test, assert_array_equals, assert_unreached } =

/* 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-getall.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-has.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-searchparams-stringifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-setters.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const request = {
};

/* 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-toascii.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const request = {
};

/* 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
*/
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-whatwg-url-tojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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
*/
Expand Down