Source code
Revision control
Copy as Markdown
Other Tools
{
"tests": {
"Relative URL scope keys should work with no prefix": {
"importMap": {
"scopes": {
"foo": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Relative URL scope keys should work with ./, ../, and / prefixes": {
"importMap": {
"scopes": {
"./foo": {},
"../foo": {},
"/foo": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Absolute URL scope keys should ignore relative URL scope keys when the base URL is a data: URL": {
"importMap": {
"scopes": {
"./foo": {},
"../foo": {},
"/foo": {}
}
},
"importMapBaseURL": "data:text/html,test",
"expectedParsedImportMap": {
"imports": {},
"scopes": {}
}
},
"Relative URL scope keys should work with ./, ../, or / with no suffix": {
"importMap": {
"scopes": {
"./": {},
"../": {},
"/": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Relative URL scope keys should work with /s, ?s, and #s": {
"importMap": {
"scopes": {
"foo/bar?baz#qux": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Relative URL scope keys should work with an empty string scope key": {
"importMap": {
"scopes": {
"": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Relative URL scope keys should work with / suffixes": {
"importMap": {
"scopes": {
"foo/": {},
"./foo/": {},
"../foo/": {},
"/foo/": {},
"/foo//": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
},
"Relative URL scope keys should deduplicate based on URL parsing rules": {
"importMap": {
"scopes": {
"foo/\\": {
"1": "./a"
},
"foo//": {
"2": "./b"
},
"foo\\\\": {
"3": "./c"
}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
}
},
"Absolute URL scope keys should accept all absolute URL scope keys, with or without fetch schemes": {
"importMap": {
"scopes": {
"about:good": {},
"blob:good": {},
"data:good": {},
"import:bad": {},
"mailto:bad": {},
"javascript:bad": {},
"wss:ba": {}
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
"about:good": {},
"blob:good": {},
"data:good": {},
"import:bad": {},
"mailto:bad": {},
"javascript:bad": {},
}
}
},
"Absolute URL scope keys should parse absolute URL scope keys, ignoring unparseable ones": {
"importMap": {
"scopes": {
"https:example.org": {},
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {
}
}
}
}
}