mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 12:01:35 +00:00
* fix(sqlite): reject schema data loss during upgrades * test(macos): align native state schema boundary
21 lines
789 B
TypeScript
21 lines
789 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
checkNativeStateSchemaVersion,
|
|
compareNativeStateSchemaVersions,
|
|
} from "../../scripts/check-native-state-schema-version.mjs";
|
|
|
|
describe("native state schema version guard", () => {
|
|
it("keeps the checked-in Swift and TypeScript contracts aligned", () => {
|
|
expect(checkNativeStateSchemaVersion()).toBe(6);
|
|
});
|
|
|
|
it("fails when a deliberate Swift fixture drifts behind TypeScript", () => {
|
|
expect(() =>
|
|
compareNativeStateSchemaVersions({
|
|
swiftSource: "private static let maximumSupportedSchemaVersion: Int64 = 5\n",
|
|
typescriptSource: "export const OPENCLAW_STATE_SCHEMA_VERSION = 6;\n",
|
|
}),
|
|
).toThrow("Native state schema version drift: Swift supports 5, TypeScript owns 6");
|
|
});
|
|
});
|