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