Skip to content

Commit 0db85dc

Browse files
committed
fixup! use /latest for redirect
1 parent 9302a24 commit 0db85dc

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

test/unit/node/update.test.ts

+4-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,9 @@ describe("update", () => {
3737
return response.end("rejected status code test")
3838
}
3939

40-
if (request.url === "/location-redirect") {
41-
const latest: LatestResponse = {
42-
name: "4.0.2",
43-
}
44-
response.writeHead(200)
45-
return response.end(JSON.stringify(latest))
46-
}
47-
4840
if (request.url === "/with-location-header") {
4941
response.writeHead(301, "testing", {
50-
location: "/location-redirect",
42+
location: "/latest",
5143
})
5244

5345
return response.end()
@@ -68,7 +60,7 @@ describe("update", () => {
6860
const newRedirectNumber = parseInt(currentRedirectNumber) - 1
6961

7062
response.writeHead(302, "testing", {
71-
location: `/redirect/${newRedirectNumber}`,
63+
location: `/redirect/${String(newRedirectNumber)}`,
7264
})
7365
return response.end("")
7466
}
@@ -254,13 +246,14 @@ describe("update", () => {
254246
})
255247

256248
it("should resolve the request with response.headers.location", async () => {
249+
version = "4.1.1"
257250
if (isAddressInfo(_address)) {
258251
const mockURL = `http://${_address.address}:${_address.port}/with-location-header`
259252
let provider = new UpdateProvider(mockURL, settings())
260253
let update = await provider.getUpdate(true)
261254

262255
expect(logger.error).not.toHaveBeenCalled()
263-
expect(update.version).toBe("4.0.2")
256+
expect(update.version).toBe("4.1.1")
264257
}
265258
})
266259

0 commit comments

Comments
 (0)