mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 08:00:45 +00:00
test: dedupe clawhub cleanup absence assertions
This commit is contained in:
@@ -20,6 +20,10 @@ import {
|
||||
searchClawHubSkills,
|
||||
} from "./clawhub.js";
|
||||
|
||||
async function expectPathMissing(targetPath: string): Promise<void> {
|
||||
await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
|
||||
}
|
||||
|
||||
describe("clawhub helpers", () => {
|
||||
const originalHome = process.env.HOME;
|
||||
|
||||
@@ -359,7 +363,7 @@ describe("clawhub helpers", () => {
|
||||
} finally {
|
||||
const archiveDir = path.dirname(archive.archivePath);
|
||||
await archive.cleanup();
|
||||
await expect(fs.stat(archiveDir)).rejects.toThrow();
|
||||
await expectPathMissing(archiveDir);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -398,7 +402,7 @@ describe("clawhub helpers", () => {
|
||||
} finally {
|
||||
const archiveDir = path.dirname(archive.archivePath);
|
||||
await archive.cleanup();
|
||||
await expect(fs.stat(archiveDir)).rejects.toThrow();
|
||||
await expectPathMissing(archiveDir);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -497,7 +501,7 @@ describe("clawhub helpers", () => {
|
||||
} finally {
|
||||
const archiveDir = path.dirname(archive.archivePath);
|
||||
await archive.cleanup();
|
||||
await expect(fs.stat(archiveDir)).rejects.toThrow();
|
||||
await expectPathMissing(archiveDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user