mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
perf(test): silence non-audit config io overwrite logs
This commit is contained in:
@@ -40,6 +40,10 @@ function restoreHomeEnv(snapshot: HomeEnvSnapshot) {
|
|||||||
describe("config io write", () => {
|
describe("config io write", () => {
|
||||||
let fixtureRoot = "";
|
let fixtureRoot = "";
|
||||||
let fixtureCount = 0;
|
let fixtureCount = 0;
|
||||||
|
const silentLogger = {
|
||||||
|
warn: () => {},
|
||||||
|
error: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-config-io-"));
|
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-config-io-"));
|
||||||
@@ -86,6 +90,7 @@ describe("config io write", () => {
|
|||||||
const io = createConfigIO({
|
const io = createConfigIO({
|
||||||
env: {} as NodeJS.ProcessEnv,
|
env: {} as NodeJS.ProcessEnv,
|
||||||
homedir: () => home,
|
homedir: () => home,
|
||||||
|
logger: silentLogger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshot = await io.readConfigFileSnapshot();
|
const snapshot = await io.readConfigFileSnapshot();
|
||||||
@@ -144,6 +149,7 @@ describe("config io write", () => {
|
|||||||
const io = createConfigIO({
|
const io = createConfigIO({
|
||||||
env: { OPENAI_API_KEY: "sk-secret" } as NodeJS.ProcessEnv,
|
env: { OPENAI_API_KEY: "sk-secret" } as NodeJS.ProcessEnv,
|
||||||
homedir: () => home,
|
homedir: () => home,
|
||||||
|
logger: silentLogger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshot = await io.readConfigFileSnapshot();
|
const snapshot = await io.readConfigFileSnapshot();
|
||||||
@@ -199,6 +205,7 @@ describe("config io write", () => {
|
|||||||
const io = createConfigIO({
|
const io = createConfigIO({
|
||||||
env: { DISCORD_USER_ID: "999" } as NodeJS.ProcessEnv,
|
env: { DISCORD_USER_ID: "999" } as NodeJS.ProcessEnv,
|
||||||
homedir: () => home,
|
homedir: () => home,
|
||||||
|
logger: silentLogger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshot = await io.readConfigFileSnapshot();
|
const snapshot = await io.readConfigFileSnapshot();
|
||||||
|
|||||||
Reference in New Issue
Block a user