| 1 | import { describe, expect, it } from "@effect/vitest"; |
| 2 | import { deviceToolInstallMessage } from "./device.ts"; |
| 3 | |
| 4 | describe("device tool install progress", () => { |
| 5 | it("distinguishes a new install from an upgrade and chooses versions numerically", () => { |
| 6 | expect( |
| 7 | deviceToolInstallMessage("device hub", { |
| 8 | requiredVersion: "0.11.0", |
| 9 | installedVersions: [], |
| 10 | runningVersion: null, |
| 11 | }), |
| 12 | ).toBe("Installing device hub 0.11.0…"); |
| 13 | expect( |
| 14 | deviceToolInstallMessage("device hub", { |
| 15 | requiredVersion: "0.11.0", |
| 16 | installedVersions: ["0.9.0", "0.10.0"], |
| 17 | runningVersion: null, |
| 18 | }), |
| 19 | ).toBe("Updating device hub from 0.10.0 to 0.11.0…"); |
| 20 | }); |
| 21 | }); |