mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:09:57 +00:00
chore(tsgo/format): fix CI errors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { migrateLegacyConfig, validateConfigObject } from "./config.js";
|
||||
import type { OpenClawConfig } from "./config.js";
|
||||
|
||||
function getLegacyRouting(config: unknown) {
|
||||
return (config as { routing?: Record<string, unknown> } | undefined)?.routing;
|
||||
@@ -470,13 +471,16 @@ describe("legacy config detection", () => {
|
||||
const res = validateConfigObject(testCase.input);
|
||||
expect(res.ok, testCase.name).toBe(true);
|
||||
if (res.ok) {
|
||||
if (testCase.expectedTopLevel !== undefined) {
|
||||
if ("expectedTopLevel" in testCase && testCase.expectedTopLevel !== undefined) {
|
||||
expect(res.config.channels?.telegram?.streaming, testCase.name).toBe(
|
||||
testCase.expectedTopLevel,
|
||||
);
|
||||
expect(res.config.channels?.telegram?.streamMode, testCase.name).toBeUndefined();
|
||||
}
|
||||
if (testCase.expectedAccountStreaming !== undefined) {
|
||||
if (
|
||||
"expectedAccountStreaming" in testCase &&
|
||||
testCase.expectedAccountStreaming !== undefined
|
||||
) {
|
||||
expect(res.config.channels?.telegram?.accounts?.ops?.streaming, testCase.name).toBe(
|
||||
testCase.expectedAccountStreaming,
|
||||
);
|
||||
|
||||
@@ -409,12 +409,12 @@ describe("redactConfigSnapshot", () => {
|
||||
}),
|
||||
assert: ({ redacted, restored }) => {
|
||||
const cfg = redacted as Record<string, Record<string, unknown>>;
|
||||
const cfgCustom2 = cfg.custom2 as unknown[];
|
||||
const cfgCustom2 = cfg.custom2 as unknown as unknown[];
|
||||
expect(cfgCustom2.length).toBeGreaterThan(0);
|
||||
expect((cfg.custom1.anykey as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
|
||||
expect((cfgCustom2[0] as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
|
||||
const out = restored as Record<string, Record<string, unknown>>;
|
||||
const outCustom2 = out.custom2 as unknown[];
|
||||
const outCustom2 = out.custom2 as unknown as unknown[];
|
||||
expect(outCustom2.length).toBeGreaterThan(0);
|
||||
expect((out.custom1.anykey as Record<string, unknown>).mySecret).toBe(
|
||||
"this-is-a-custom-secret-value",
|
||||
@@ -436,12 +436,12 @@ describe("redactConfigSnapshot", () => {
|
||||
}),
|
||||
assert: ({ redacted, restored }) => {
|
||||
const cfg = redacted as Record<string, Record<string, unknown>>;
|
||||
const cfgCustom2 = cfg.custom2 as unknown[];
|
||||
const cfgCustom2 = cfg.custom2 as unknown as unknown[];
|
||||
expect(cfgCustom2.length).toBeGreaterThan(0);
|
||||
expect((cfg.custom1.anykey as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
|
||||
expect((cfgCustom2[0] as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
|
||||
const out = restored as Record<string, Record<string, unknown>>;
|
||||
const outCustom2 = out.custom2 as unknown[];
|
||||
const outCustom2 = out.custom2 as unknown as unknown[];
|
||||
expect(outCustom2.length).toBeGreaterThan(0);
|
||||
expect((out.custom1.anykey as Record<string, unknown>).mySecret).toBe(
|
||||
"this-is-a-custom-secret-value",
|
||||
|
||||
Reference in New Issue
Block a user