mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 08:01:25 +00:00
f1e84cb088
* feat: add backend preview validation to ai evals Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: refresh shared preview workspace assets Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: harden shared backend preview validation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import {
|
|
parseBackendValidationMode,
|
|
resolveBackendValidationSettings,
|
|
} from "./backendValidation";
|
|
|
|
describe("parseBackendValidationMode", () => {
|
|
it("defaults to off", () => {
|
|
expect(parseBackendValidationMode(undefined)).toBe("off");
|
|
expect(parseBackendValidationMode("0")).toBe("off");
|
|
expect(parseBackendValidationMode("false")).toBe("off");
|
|
});
|
|
|
|
it("accepts preview aliases", () => {
|
|
expect(parseBackendValidationMode("preview")).toBe("preview");
|
|
expect(parseBackendValidationMode("1")).toBe("preview");
|
|
expect(parseBackendValidationMode("true")).toBe("preview");
|
|
});
|
|
|
|
it("rejects unknown modes", () => {
|
|
expect(() => parseBackendValidationMode("maybe")).toThrow(
|
|
"Unsupported backend validation mode: maybe"
|
|
);
|
|
});
|
|
});
|
|
|
|
describe("resolveBackendValidationSettings", () => {
|
|
it("rejects unsupported eval modes", () => {
|
|
expect(() =>
|
|
resolveBackendValidationSettings({
|
|
evalMode: "app",
|
|
requestedMode: "preview",
|
|
})
|
|
).toThrow('Backend validation mode "preview" is only supported for flow and script evals');
|
|
});
|
|
});
|