Source code
Revision control
Copy as Markdown
Other Tools
{
"name": "Relative URL-like addresses",
"tests": {
"should accept strings prefixed with ./, ../, or /": {
"importMap": {
"imports": {
"dotSlash": "./foo",
"dotDotSlash": "../foo",
"slash": "/foo"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"should not accept strings prefixed with ./, ../, or / for data: base URLs": {
"importMap": {
"imports": {
"dotSlash": "./foo",
"dotDotSlash": "../foo",
"slash": "/foo"
}
},
"importMapBaseURL": "data:text/html,test",
"expectedParsedImportMap": {
"imports": {
"dotSlash": null,
"dotDotSlash": null,
"slash": null
},
"scopes": {}
}
},
"should accept the literal strings ./, ../, or / with no suffix": {
"importMap": {
"imports": {
"dotSlash": "./",
"dotDotSlash": "../",
"slash": "/"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"should ignore percent-encoded variants of ./, ../, or /": {
"importMap": {
"imports": {
"dotSlash1": "%2E/",
"dotDotSlash1": "%2E%2E/",
"dotSlash2": ".%2F",
"dotDotSlash2": "..%2F",
"slash2": "%2F",
"dotSlash3": "%2E%2F",
"dotDotSlash3": "%2E%2E%2F"
}
},
"expectedParsedImportMap": {
"imports": {
"dotSlash1": null,
"dotDotSlash1": null,
"dotSlash2": null,
"dotDotSlash2": null,
"slash2": null,
"dotSlash3": null,
"dotDotSlash3": null
},
"scopes": {}
}
}
}
}