


























@@ -391,22 +391,17 @@ describe("createBackupArchive", () => {
391391const entries = await listArchiveEntries(result.archivePath);
392392393393const entrySuffixes = entries.map((entry) => entry.replace(/^.*\/state\//, "/state/"));
394-expect(entrySuffixes).toEqual(
395-expect.arrayContaining([
396-"/state/extensions/demo/openclaw.plugin.json",
397-"/state/extensions/demo/src/index.js",
398-"/state/node_modules/root-dep/index.js",
399-]),
400-);
394+expect(entrySuffixes).toContain("/state/extensions/demo/openclaw.plugin.json");
395+expect(entrySuffixes).toContain("/state/extensions/demo/src/index.js");
396+expect(entrySuffixes).toContain("/state/node_modules/root-dep/index.js");
401397const pluginNodeModuleEntries = entries.filter((entry) =>
402398entry.includes("/state/extensions/demo/node_modules/"),
403399);
404400expect(pluginNodeModuleEntries).toStrictEqual([]);
405401406402const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
407-await expect(
408-backupVerifyCommand(runtime, { archive: result.archivePath }),
409-).resolves.toMatchObject({ ok: true });
403+const verification = await backupVerifyCommand(runtime, { archive: result.archivePath });
404+expect(verification.ok).toBe(true);
410405},
411406);
412407});
@@ -439,9 +434,8 @@ describe("createBackupArchive", () => {
439434expect(rootManifestEntries).toHaveLength(1);
440435441436const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
442-await expect(
443-backupVerifyCommand(runtime, { archive: result.archivePath }),
444-).resolves.toMatchObject({ ok: true });
437+const verification = await backupVerifyCommand(runtime, { archive: result.archivePath });
438+expect(verification.ok).toBe(true);
445439} finally {
446440tmpdirSpy.mockRestore();
447441}
@@ -474,9 +468,8 @@ describe("createBackupArchive", () => {
474468expect(rootManifestEntries).toHaveLength(1);
475469476470const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
477-await expect(
478-backupVerifyCommand(runtime, { archive: result.archivePath }),
479-).resolves.toMatchObject({ ok: true });
471+const verification = await backupVerifyCommand(runtime, { archive: result.archivePath });
472+expect(verification.ok).toBe(true);
480473} finally {
481474tmpdirSpy.mockRestore();
482475}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。