Archived
1
0

Fix crash when unable to request an update

This commit is contained in:
Asher
2020-03-25 15:00:35 -05:00
parent 27320465b7
commit 0a5687bacf
2 changed files with 21 additions and 1 deletions

View File

@ -222,4 +222,23 @@ describe("update", () => {
const archiveName = await p.getReleaseName(update)
assert.deepEqual(spy, ["/latest", `/download/${version}/${archiveName}`, `/download/${version}/${archiveName}`])
})
it("should not reject if unable to fetch", async () => {
const options = {
auth: AuthType.None,
base: "/update",
commit: "test",
}
let provider = new UpdateHttpProvider(options, true, "invalid", "invalid", settings)
await assert.doesNotReject(() => provider.getUpdate(true))
provider = new UpdateHttpProvider(
options,
true,
"http://probably.invalid.dev.localhost/latest",
"http://probably.invalid.dev.localhost/download",
settings,
)
await assert.doesNotReject(() => provider.getUpdate(true))
})
})