Guard against no hosted git info

Closes #6693
This commit is contained in:
Kevin Sawicki
2015-05-07 13:23:14 -07:00
parent 055f05cfe1
commit b7dddeebfe
3 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
{
"name": "package-with-invalid-url-package-json",
"repository": "foo"
}

View File

@@ -46,6 +46,10 @@ describe "PackageManager", ->
expect(metadata.repository.type).toBe "git"
expect(metadata.repository.url).toBe "https://github.com/example/repo.git"
{metadata} = atom.packages.loadPackage("package-with-invalid-url-package-json")
expect(metadata.repository.type).toBe "git"
expect(metadata.repository.url).toBe "foo"
it "returns null if the package is not found in any package directory", ->
spyOn(console, 'warn')
expect(atom.packages.loadPackage("this-package-cannot-be-found")).toBeNull()