
























@@ -20,6 +20,10 @@ import {
2020searchClawHubSkills,
2121} from "./clawhub.js";
222223+async function expectPathMissing(targetPath: string): Promise<void> {
24+await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
25+}
26+2327describe("clawhub helpers", () => {
2428const originalHome = process.env.HOME;
2529@@ -359,7 +363,7 @@ describe("clawhub helpers", () => {
359363} finally {
360364const archiveDir = path.dirname(archive.archivePath);
361365await archive.cleanup();
362-await expect(fs.stat(archiveDir)).rejects.toThrow();
366+await expectPathMissing(archiveDir);
363367}
364368});
365369@@ -398,7 +402,7 @@ describe("clawhub helpers", () => {
398402} finally {
399403const archiveDir = path.dirname(archive.archivePath);
400404await archive.cleanup();
401-await expect(fs.stat(archiveDir)).rejects.toThrow();
405+await expectPathMissing(archiveDir);
402406}
403407});
404408@@ -497,7 +501,7 @@ describe("clawhub helpers", () => {
497501} finally {
498502const archiveDir = path.dirname(archive.archivePath);
499503await archive.cleanup();
500-await expect(fs.stat(archiveDir)).rejects.toThrow();
504+await expectPathMissing(archiveDir);
501505}
502506});
503507});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。