70bf21e064
Handle Changesets / Handle Changesets (push) Waiting to run
Semgrep OSS scan / semgrep-oss (push) Waiting to run
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
import { it } from "vitest";
|
|
import { getNextMiniflareVersion } from "../../../.github/changeset-version";
|
|
|
|
// prettier-ignore
|
|
const miniflareVersionTestCases = [
|
|
// workerd, mf previous, bump mf after, mf corrected
|
|
["1.20231001.0", "3.20231001.0", /* patch */ "3.20231001.1", "3.20231001.1"],
|
|
["1.20231001.0", "3.20231001.0", /* minor */ "3.20231002.0", "3.20231001.1"],
|
|
["1.20231002.0", "3.20231001.0", /* minor */ "3.20231002.0", "3.20231002.0"],
|
|
["1.20231001.0", "3.20231001.2", /* minor */ "3.20231002.0", "3.20231001.3"],
|
|
["1.20231001.0", "3.20231001.0", /* major */ "4.0.0", "4.20231001.0"],
|
|
["1.20231008.0", "3.20231001.0", /* patch */ "3.20231001.1", "3.20231008.0"],
|
|
["1.20231008.0", "3.20231001.0", /* minor */ "3.20231002.0", "3.20231008.0"],
|
|
["1.20231008.0", "3.20231001.0", /* major */ "4.0.0", "4.20231008.0"],
|
|
];
|
|
|
|
for (const [
|
|
workerdVersion,
|
|
previousMiniflareVersion,
|
|
miniflareVersion,
|
|
correctMiniflareVersion,
|
|
] of miniflareVersionTestCases) {
|
|
it(`changeset version ${workerdVersion} ${previousMiniflareVersion} -> ${miniflareVersion} = ${correctMiniflareVersion}`, ({
|
|
expect,
|
|
}) => {
|
|
const actual = getNextMiniflareVersion(
|
|
workerdVersion,
|
|
previousMiniflareVersion,
|
|
miniflareVersion
|
|
);
|
|
expect(actual).toEqual(correctMiniflareVersion);
|
|
});
|
|
}
|