mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:38:27 +00:00
test: dedupe and optimize test suites
This commit is contained in:
@@ -147,22 +147,23 @@ describe("update-startup", () => {
|
||||
return { log, parsed };
|
||||
}
|
||||
|
||||
it("logs update hint for npm installs when newer tag exists", async () => {
|
||||
const { log, parsed } = await runUpdateCheckAndReadState("stable");
|
||||
it.each([
|
||||
{
|
||||
name: "stable channel",
|
||||
channel: "stable" as const,
|
||||
},
|
||||
{
|
||||
name: "beta channel with older beta tag",
|
||||
channel: "beta" as const,
|
||||
},
|
||||
])("logs latest update hint for $name", async ({ channel }) => {
|
||||
const { log, parsed } = await runUpdateCheckAndReadState(channel);
|
||||
|
||||
expect(log.info).toHaveBeenCalledWith(
|
||||
expect.stringContaining("update available (latest): v2.0.0"),
|
||||
);
|
||||
expect(parsed.lastNotifiedVersion).toBe("2.0.0");
|
||||
expect(parsed.lastAvailableVersion).toBe("2.0.0");
|
||||
});
|
||||
|
||||
it("uses latest when beta tag is older than release", async () => {
|
||||
const { log, parsed } = await runUpdateCheckAndReadState("beta");
|
||||
|
||||
expect(log.info).toHaveBeenCalledWith(
|
||||
expect.stringContaining("update available (latest): v2.0.0"),
|
||||
);
|
||||
expect(parsed.lastNotifiedTag).toBe("latest");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user