Source code
Revision control
Copy as Markdown
Other Tools
{
"tests": {
"Relative URL specifier keys should absolutize strings prefixed with ./, ../, or / into the corresponding URLs": {
"importMap": {
"imports": {
"./foo": "/dotslash",
"../foo": "/dotdotslash",
"/foo": "/slash"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should not absolutize strings prefixed with ./, ../, or / with a data: URL base": {
"importMap": {
"imports": {
}
},
"importMapBaseURL": "data:text/html,",
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should absolutize the literal strings ./, ../, or / with no suffix": {
"importMap": {
"imports": {
"./": "/dotslash/",
"../": "/dotdotslash/",
"/": "/slash/"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should work with /s, ?s, and #s": {
"importMap": {
"imports": {
"./foo/bar?baz#qux": "/foo"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should ignore an empty string key": {
"importMap": {
"imports": {
"": "/foo"
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {}
}
},
"Relative URL specifier keys should treat percent-encoded variants of ./, ../, or / as bare specifiers": {
"importMap": {
"imports": {
"%2E/": "/dotSlash1/",
"%2E%2E/": "/dotDotSlash1/",
".%2F": "/dotSlash2",
"..%2F": "/dotDotSlash2",
"%2F": "/slash2",
"%2E%2F": "/dotSlash3",
"%2E%2E%2F": "/dotDotSlash3"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should deduplicate based on URL parsing rules": {
"importMap": {
"imports": {
"./foo/\\": "/foo1",
"./foo//": "/foo2",
"./foo\\\\": "/foo3"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Absolute URL specifier keys should accept all absolute URL specifier keys, with or without fetch schemes": {
"importMap": {
"imports": {
"about:good": "/about",
"blob:good": "/blob",
"data:good": "/data",
"import:bad": "/import",
"mailto:bad": "/mailto",
"javascript:bad": "/javascript",
"wss:bad": "/wss"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Absolute URL specifier keys should parse absolute URLs, treating unparseable ones as bare specifiers": {
"importMap": {
"imports": {
"https:example.org": "/invalidButParseable1/",
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Specifier keys should be sort correctly (issue #181) - Test #1": {
"importMap": {
"imports": {
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Specifier keys should be sort correctly (issue #181) - Test #2": {
"importMap": {
"imports": {
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
}
}
}