mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Kill dead code
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
40392ac195
commit
152769e0d8
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { nextUpdateChannel } from "../update-channel";
|
||||
|
||||
describe("nextUpdateChannel", () => {
|
||||
it("returns latest if current channel is latest", () => {
|
||||
expect(nextUpdateChannel("latest", "latest")).toEqual("latest");
|
||||
});
|
||||
|
||||
it("returns beta if current channel is alpha", () => {
|
||||
expect(nextUpdateChannel("alpha", "alpha")).toEqual("beta");
|
||||
expect(nextUpdateChannel("beta", "alpha")).toEqual("beta");
|
||||
expect(nextUpdateChannel("rc", "alpha")).toEqual("beta");
|
||||
expect(nextUpdateChannel("latest", "alpha")).toEqual("beta");
|
||||
});
|
||||
|
||||
it("returns latest if current channel is beta", () => {
|
||||
expect(nextUpdateChannel("alpha", "beta")).toEqual("latest");
|
||||
expect(nextUpdateChannel("beta", "beta")).toEqual("latest");
|
||||
expect(nextUpdateChannel("rc", "beta")).toEqual("latest");
|
||||
expect(nextUpdateChannel("latest", "beta")).toEqual("latest");
|
||||
});
|
||||
|
||||
it("returns default if current channel is unknown", () => {
|
||||
expect(nextUpdateChannel("alpha", "rc")).toEqual("alpha");
|
||||
expect(nextUpdateChannel("beta", "rc")).toEqual("beta");
|
||||
expect(nextUpdateChannel("rc", "rc")).toEqual("rc");
|
||||
expect(nextUpdateChannel("latest", "rc")).toEqual("latest");
|
||||
});
|
||||
});
|
||||
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Compute the next update channel from the current updating channel
|
||||
* @param defaultChannel The default (initial) channel to check
|
||||
* @param channel The current channel that did not have a new version associated with it
|
||||
* @returns The channel name of the next release version
|
||||
*/
|
||||
export function nextUpdateChannel(defaultChannel: string, channel: string | null): string {
|
||||
switch (channel) {
|
||||
case "alpha":
|
||||
return "beta";
|
||||
case "beta":
|
||||
return "latest"; // there is no RC currently
|
||||
default:
|
||||
return defaultChannel;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user