refactor: trim cron test helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 12:45:18 +01:00
parent e1a7c5b860
commit 0b4bc78496
3 changed files with 6 additions and 6 deletions

View File

@@ -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,

View File

@@ -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-" });

View File

@@ -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;