test: dedupe agent tests and session helpers

This commit is contained in:
Peter Steinberger
2026-02-22 17:11:17 +00:00
parent 415686244a
commit ad1072842e
31 changed files with 1021 additions and 1109 deletions

View File

@@ -0,0 +1,13 @@
import { expect } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
export function expectGeneratedTokenPersistedToGatewayAuth(params: {
generatedToken?: string;
authToken?: string;
persistedConfig?: OpenClawConfig;
}) {
expect(params.generatedToken).toMatch(/^[0-9a-f]{48}$/);
expect(params.authToken).toBe(params.generatedToken);
expect(params.persistedConfig?.gateway?.auth?.mode).toBe("token");
expect(params.persistedConfig?.gateway?.auth?.token).toBe(params.generatedToken);
}