test: stabilize hooks loader log assertion on Windows
This commit is contained in:
@@ -5,6 +5,7 @@ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi }
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { setLoggerOverride } from "../logging/logger.js";
|
||||
import { loggingState } from "../logging/state.js";
|
||||
import { stripAnsi } from "../terminal/ansi.js";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
import {
|
||||
clearInternalHooks,
|
||||
@@ -361,9 +362,11 @@ describe("loader", () => {
|
||||
|
||||
await expectNoCommandHookRegistration(cfg);
|
||||
|
||||
const messages = (error as ReturnType<typeof vi.fn>).mock.calls
|
||||
.map((call) => String(call[0] ?? ""))
|
||||
.join("\n");
|
||||
const messages = stripAnsi(
|
||||
(error as ReturnType<typeof vi.fn>).mock.calls
|
||||
.map((call) => String(call[0] ?? ""))
|
||||
.join("\n"),
|
||||
);
|
||||
expect(messages).toContain("forged-log");
|
||||
expect(messages).not.toContain("\u001b[31m");
|
||||
expect(messages).not.toContain("\nforged-log");
|
||||
|
||||
Reference in New Issue
Block a user