0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-whatwg-url-historical.js
Gautam Arora 9e4ab6c206
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>
2017-07-20 16:22:02 -04:00

47 lines
1.5 KiB
JavaScript

'use strict';
const common = require('../common');
if (!common.hasIntl) {
// A handful of the tests fail when ICU is not included.
common.skip('missing Intl');
}
const URL = require('url').URL;
const { test, assert_equals, assert_throws } = require('../common/wpt');
/* 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"],
// [function() { return document.createElement("area") }, "area element"],
// ];
// objects.forEach(function(o) {
// test(function() {
// var object = o[0]();
// assert_false("searchParams" in object,
// o[1] + " should not have a searchParams attribute");
// }, "searchParams on " + o[1]);
// });
test(function() {
var url = new URL("./foo", "http://www.example.org");
assert_equals(url.href, "http://www.example.org/foo");
assert_throws(new TypeError(), function() {
url.href = "./bar";
});
}, "Setting URL's href attribute and base URLs");
test(function() {
assert_equals(URL.domainToASCII, undefined);
}, "URL.domainToASCII should be undefined");
test(function() {
assert_equals(URL.domainToUnicode, undefined);
}, "URL.domainToUnicode should be undefined");
/* eslint-enable */