test(core): use lightweight clears in update, child adapter, and copilot token setup

This commit is contained in:
Peter Steinberger
2026-02-22 07:50:56 +00:00
parent be5921e8fe
commit 1f0695ba47
3 changed files with 6 additions and 6 deletions

View File

@@ -77,14 +77,14 @@ vi.mock("./validation.js", () => ({
beforeEach(() => {
capturedPayload = undefined;
runGatewayUpdateMock.mockReset();
runGatewayUpdateMock.mockClear();
runGatewayUpdateMock.mockResolvedValue({
status: "ok",
mode: "npm",
steps: [],
durationMs: 100,
});
scheduleGatewaySigusr1RestartMock.mockReset();
scheduleGatewaySigusr1RestartMock.mockClear();
scheduleGatewaySigusr1RestartMock.mockReturnValue({ scheduled: true });
});

View File

@@ -54,8 +54,8 @@ describe("createChildAdapter", () => {
});
beforeEach(() => {
spawnWithFallbackMock.mockReset();
killProcessTreeMock.mockReset();
spawnWithFallbackMock.mockClear();
killProcessTreeMock.mockClear();
});
it("uses process-tree kill for default SIGKILL", async () => {

View File

@@ -10,8 +10,8 @@ describe("github-copilot token", () => {
const cachePath = "/tmp/openclaw-state/credentials/github-copilot.token.json";
beforeEach(() => {
loadJsonFile.mockReset();
saveJsonFile.mockReset();
loadJsonFile.mockClear();
saveJsonFile.mockClear();
});
it("derives baseUrl from token", async () => {