feat(FN-3389): fix scheduled evaluator integration types
Completes typing for the scheduled evaluator integration in the cron runner and project engine, with corresponding test updates in the evaluator test file. Fusion-Task-Id: FN-3389
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { CronRunner, createAiPromptExecutor, isInProcessBackupCommand } from "../cron-runner.js";
|
||||
import { CronRunner, createAiPromptExecutor, isInProcessBackupCommand, isInProcessScheduledEvalCommand } from "../cron-runner.js";
|
||||
import type { AiPromptExecutor } from "../cron-runner.js";
|
||||
import type { TaskStore, AutomationStore, ScheduledTask, AutomationRunResult, AutomationStep, Settings } from "@fusion/core";
|
||||
import { randomUUID } from "node:crypto";
|
||||
@@ -1842,4 +1842,17 @@ describe("CronRunner", () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("isInProcessScheduledEvalCommand", () => {
|
||||
it("matches canonical scheduled eval command", () => {
|
||||
expect(isInProcessScheduledEvalCommand("fn eval --scheduled-batch")).toBe(true);
|
||||
expect(isInProcessScheduledEvalCommand("fusion eval --scheduled-batch --flag")).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects non-canonical and shell-metachar commands", () => {
|
||||
expect(isInProcessScheduledEvalCommand("fn eval")).toBe(false);
|
||||
expect(isInProcessScheduledEvalCommand("fn eval --scheduled-batch && echo x")).toBe(false);
|
||||
expect(isInProcessScheduledEvalCommand("echo fn eval --scheduled-batch")).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user