generated from nhcarrigan/template
chore: bump supported CLI version to 2.1.74
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
const SUPPORTED_CLI_VERSION = "2.1.72";
|
const SUPPORTED_CLI_VERSION = "2.1.74";
|
||||||
|
|
||||||
let installedVersion = $state("Loading...");
|
let installedVersion = $state("Loading...");
|
||||||
let latestNpmVersion = $state<string | null>(null);
|
let latestNpmVersion = $state<string | null>(null);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
|
|
||||||
const SUPPORTED_CLI_VERSION = "2.1.72";
|
const SUPPORTED_CLI_VERSION = "2.1.74";
|
||||||
|
|
||||||
function compareVersions(a: string, b: string): number {
|
function compareVersions(a: string, b: string): number {
|
||||||
const aParts = a.split(".").map(Number);
|
const aParts = a.split(".").map(Number);
|
||||||
@@ -41,7 +41,7 @@ describe("SUPPORTED_CLI_VERSION", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("matches the expected audited version", () => {
|
it("matches the expected audited version", () => {
|
||||||
expect(SUPPORTED_CLI_VERSION).toBe("2.1.72");
|
expect(SUPPORTED_CLI_VERSION).toBe("2.1.74");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ describe("compareVersions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("returns 0 for exactly the supported version", () => {
|
it("returns 0 for exactly the supported version", () => {
|
||||||
expect(compareVersions("2.1.72", SUPPORTED_CLI_VERSION)).toBe(0);
|
expect(compareVersions("2.1.74", SUPPORTED_CLI_VERSION)).toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -149,34 +149,34 @@ describe("updateAvailable", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("returns false when installed is Loading...", () => {
|
it("returns false when installed is Loading...", () => {
|
||||||
expect(isUpdateAvailable("Loading...", "2.1.72")).toBe(false);
|
expect(isUpdateAvailable("Loading...", "2.1.74")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false when installed is Unknown", () => {
|
it("returns false when installed is Unknown", () => {
|
||||||
expect(isUpdateAvailable("Unknown", "2.1.72")).toBe(false);
|
expect(isUpdateAvailable("Unknown", "2.1.74")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false when installed equals latest", () => {
|
it("returns false when installed equals latest", () => {
|
||||||
expect(isUpdateAvailable("2.1.72", "2.1.72")).toBe(false);
|
expect(isUpdateAvailable("2.1.74", "2.1.74")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false when installed is ahead of latest", () => {
|
it("returns false when installed is ahead of latest", () => {
|
||||||
expect(isUpdateAvailable("2.1.73", "2.1.72")).toBe(false);
|
expect(isUpdateAvailable("2.1.75", "2.1.74")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns true when installed is behind latest", () => {
|
it("returns true when installed is behind latest", () => {
|
||||||
expect(isUpdateAvailable("2.1.70", "2.1.72")).toBe(true);
|
expect(isUpdateAvailable("2.1.70", "2.1.74")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns true when installed has a lower minor version", () => {
|
it("returns true when installed has a lower minor version", () => {
|
||||||
expect(isUpdateAvailable("2.0.99", "2.1.72")).toBe(true);
|
expect(isUpdateAvailable("2.0.99", "2.1.74")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles version strings with extra info like '2.1.70 (build 123)'", () => {
|
it("handles version strings with extra info like '2.1.70 (build 123)'", () => {
|
||||||
expect(isUpdateAvailable("2.1.70 (build 123)", "2.1.72")).toBe(true);
|
expect(isUpdateAvailable("2.1.70 (build 123)", "2.1.74")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns false for unparseable installed version", () => {
|
it("returns false for unparseable installed version", () => {
|
||||||
expect(isUpdateAvailable("not-a-version", "2.1.72")).toBe(false);
|
expect(isUpdateAvailable("not-a-version", "2.1.74")).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user