18 lines
594 B
TypeScript
18 lines
594 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
test("no migration targets a version below 0.8.0", () => {
|
|
const source = readFileSync(join(import.meta.dir, "../src/update.ts"), "utf8");
|
|
const versions = [...source.matchAll(/version:\s*"([0-9.]+)"/g)].map((match) => match[1]!);
|
|
|
|
expect(versions.length).toBeGreaterThan(0);
|
|
|
|
const belowFloor = versions.filter((version) => {
|
|
const [major, minor] = version.split(".").map(Number);
|
|
return major! === 0 && minor! < 8;
|
|
});
|
|
|
|
expect(belowFloor).toEqual([]);
|
|
});
|