mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
refactor: trim cron test helper exports
This commit is contained in:
@@ -25,7 +25,7 @@ export function makeDeps(): CliDeps {
|
||||
};
|
||||
}
|
||||
|
||||
export function mockEmbeddedPayloads(payloads: Array<{ text?: string; isError?: boolean }>) {
|
||||
function mockEmbeddedPayloads(payloads: Array<{ text?: string; isError?: boolean }>) {
|
||||
vi.mocked(runEmbeddedPiAgent).mockResolvedValue({
|
||||
payloads,
|
||||
meta: {
|
||||
@@ -35,7 +35,7 @@ export function mockEmbeddedPayloads(payloads: Array<{ text?: string; isError?:
|
||||
});
|
||||
}
|
||||
|
||||
export function mockEmbeddedTexts(texts: string[]) {
|
||||
function mockEmbeddedTexts(texts: string[]) {
|
||||
mockEmbeddedPayloads(texts.map((text) => ({ text })));
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export async function readSessionEntry(storePath: string, key: string) {
|
||||
}
|
||||
|
||||
export const DEFAULT_MESSAGE = "do it";
|
||||
export const DEFAULT_SESSION_KEY = "cron:job-1";
|
||||
const DEFAULT_SESSION_KEY = "cron:job-1";
|
||||
export const DEFAULT_AGENT_TURN_PAYLOAD: CronJob["payload"] = {
|
||||
kind: "agentTurn",
|
||||
message: DEFAULT_MESSAGE,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from "../../test/helpers/cron/service-regression-fixtures.js";
|
||||
import { CronService } from "./service.js";
|
||||
|
||||
export type CronServiceOptions = ConstructorParameters<typeof CronService>[0];
|
||||
type CronServiceOptions = ConstructorParameters<typeof CronService>[0];
|
||||
|
||||
export const setupCronIssueRegressionFixtures = () =>
|
||||
setupCronRegressionFixtures({ prefix: "cron-issues-" });
|
||||
|
||||
@@ -8,7 +8,7 @@ import { CronService } from "./service.js";
|
||||
import { createCronServiceState, type CronServiceState } from "./service/state.js";
|
||||
import type { CronJob } from "./types.js";
|
||||
|
||||
export type NoopLogger = {
|
||||
type NoopLogger = {
|
||||
debug: MockFn;
|
||||
info: MockFn;
|
||||
warn: MockFn;
|
||||
@@ -204,7 +204,7 @@ export function createRunningCronServiceState(params: {
|
||||
return state;
|
||||
}
|
||||
|
||||
export function disposeCronServiceState(state: { timer: NodeJS.Timeout | null }): void {
|
||||
function disposeCronServiceState(state: { timer: NodeJS.Timeout | null }): void {
|
||||
if (state.timer) {
|
||||
clearTimeout(state.timer);
|
||||
state.timer = null;
|
||||
|
||||
Reference in New Issue
Block a user