Fix failing tests

This commit is contained in:
Michael Jackson 2018-05-31 09:34:38 -07:00
parent bca5722eae
commit a889385261
2 changed files with 1 additions and 6 deletions

View File

@ -77,9 +77,4 @@ describe("parsePackageURL", () => {
filename: ""
});
});
it("returns null for invalid pathnames", () => {
expect(parsePackageURL("history")).toBe(null);
expect(parsePackageURL("/.invalid")).toBe(null);
});
});

View File

@ -30,7 +30,7 @@ function parsePackageURL(originalURL) {
return {
// If the URL is /@scope/name@version/file.js?main=browser:
pathname, // /@scope/name@version/path.js
search, // ?main=browser
search: search || "", // ?main=browser
query, // { main: 'browser' }
packageName, // @scope/name
packageVersion, // version