Files
tutti/tools/scripts/desktop-build-version.test.mjs
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

50 lines
1.4 KiB
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import {
normalizeDesktopGitDescribeVersion,
resolveDesktopBuildVersion
} from "../../apps/desktop/scripts/lib/desktopBuildVersion.mjs";
test("normalizes exact desktop release tags for electron-builder", () => {
assert.equal(normalizeDesktopGitDescribeVersion("v1.2.3"), "1.2.3");
assert.equal(normalizeDesktopGitDescribeVersion("v1.2.3-rc.4"), "1.2.3-rc.4");
assert.equal(
normalizeDesktopGitDescribeVersion("tutti-desktop-v1.2.3"),
"1.2.3"
);
assert.equal(
normalizeDesktopGitDescribeVersion("tutti-desktop-v1.2.3-rc.4"),
"1.2.3-rc.4"
);
});
test("normalizes git describe output after a desktop release tag", () => {
assert.equal(
normalizeDesktopGitDescribeVersion("v1.2.3-4-gabcdef12"),
"1.2.3-4-gabcdef12"
);
assert.equal(
normalizeDesktopGitDescribeVersion(
"tutti-desktop-v1.2.3-rc.4-5-gabcdef12-dirty"
),
"1.2.3-rc.4-5-gabcdef12-dirty"
);
});
test("normalizes hash-only git describe output into semver prerelease", () => {
assert.equal(
normalizeDesktopGitDescribeVersion("abcdef12"),
"0.0.0-abcdef12"
);
});
test("prefers explicit release tag over git describe output", () => {
const version = resolveDesktopBuildVersion({
releaseTag: "v2.0.0",
describeVersion: "tutti-desktop-v1.9.9-2-gabcdef12"
});
assert.equal(version, "2.0.0");
});