





















@@ -19,6 +19,10 @@ async function runExtractedArchiveFailureCase(configureArchive: () => void) {
1919});
2020}
212122+function firstMockCall<T extends unknown[]>(mock: { mock: { calls: T[] } }): T | undefined {
23+return mock.mock.calls[0];
24+}
25+2226describe("resolveExistingInstallPath", () => {
2327it("returns resolved path and stat for existing files", async () => {
2428await withTempDir({ prefix: "openclaw-install-flow-" }, async (fixtureRoot) => {
@@ -76,11 +80,11 @@ describe("withExtractedArchiveRoot", () => {
7680});
77817882expect(withTempDirSpy).toHaveBeenCalledTimes(1);
79-const withTempDirCall = withTempDirSpy.mock.calls.at(0);
83+const withTempDirCall = firstMockCall(withTempDirSpy);
8084expect(withTempDirCall?.[0]).toBe("openclaw-plugin-");
8185expect(typeof withTempDirCall?.[1]).toBe("function");
8286expect(extractSpy).toHaveBeenCalledOnce();
83-expect(extractSpy.mock.calls.at(0)?.[0]?.archivePath).toBe(archivePath);
87+expect(firstMockCall(extractSpy)?.[0]?.archivePath).toBe(archivePath);
8488expect(resolveRootSpy).toHaveBeenCalledWith(extractDir, {
8589rootMarkers: ["package.json"],
8690});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。