Files
sweet/packages/fresh/tests/fresh_versions_test.ts
T
3822b4a21b test: add fresh_version_check test (#3029)
add a test file to auto check the fresh_version, based on deno.json
--version.

Close #3024 

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 08:20:01 +00:00

20 lines
701 B
TypeScript

import { expect } from "@std/expect";
import { satisfies, tryParseRange } from "@std/semver";
import { parse } from "@std/semver/parse";
import rootConfig from "../../../deno.json" with { type: "json" };
import freshConfig from "../deno.json" with { type: "json" };
Deno.test("Fresh version consistency", () => {
const freshImport: string = rootConfig.imports.fresh;
const rangeStr = freshImport.split("@").pop()!;
const importRange = tryParseRange(rangeStr);
if (importRange === undefined) {
throw new Error(`Could not parse semver range from: ${freshImport}`);
}
const packageVersion = parse(freshConfig.version);
expect(satisfies(packageVersion, importRange)).toBe(true);
});