t3-code-android-nightly/packages/contracts/src/device.test.ts

21 lines
718 B
TypeScript

import { describe, expect, it } from "@effect/vitest";
import { deviceToolInstallMessage } from "./device.ts";
describe("device tool install progress", () => {
it("distinguishes a new install from an upgrade and chooses versions numerically", () => {
expect(
deviceToolInstallMessage("device hub", {
requiredVersion: "0.11.0",
installedVersions: [],
runningVersion: null,
}),
).toBe("Installing device hub 0.11.0…");
expect(
deviceToolInstallMessage("device hub", {
requiredVersion: "0.11.0",
installedVersions: ["0.9.0", "0.10.0"],
runningVersion: null,
}),
).toBe("Updating device hub from 0.10.0 to 0.11.0…");
});
});