mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
test(core): use lightweight clears in update, child adapter, and copilot token setup
This commit is contained in:
@@ -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 });
|
||||
});
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ describe("createChildAdapter", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
spawnWithFallbackMock.mockReset();
|
||||
killProcessTreeMock.mockReset();
|
||||
spawnWithFallbackMock.mockClear();
|
||||
killProcessTreeMock.mockClear();
|
||||
});
|
||||
|
||||
it("uses process-tree kill for default SIGKILL", async () => {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user