Source code
Revision control
Copy as Markdown
Other Tools
[
{
"property": "origin",
"set": null
},
{
"property": "protocol",
"get": ":",
"set": "https"
},
{
"property": "username"
},
{
"property": "password"
},
{
"property": "host"
},
{
"property": "hostname"
},
{
"property": "port",
"set": "8000"
},
{
"property": "pathname"
},
{
"property": "search"
},
{
"property": "hash"
}
].forEach(({ property, get = "", set = "string" }) => {
["a", "area"].forEach(name => {
test(() => {
const link = document.createElement(name);
assert_equals(link[property], get);
if (set !== null) {
test(() => {
const link = document.createElement(name);
link[property] = set;
assert_equals(link[property], get);
}
});
});