























@@ -175,18 +175,18 @@ describe("createBackupArchive", () => {
175175});
176176const entries = await listArchiveEntries(result.archivePath);
177177178-expect(
179-entries.some((entry) => entry.endsWith("/state/extensions/demo/openclaw.plugin.json")),
180-).toBe(true);
181-expect(entries.some((entry) => entry.endsWith("/state/extensions/demo/src/index.js"))).toBe(
182-true,
178+const entrySuffixes = entries.map((entry) => entry.replace(/^.*\/state\//, "/state/"));
179+expect(entrySuffixes).toEqual(
180+expect.arrayContaining([
181+"/state/extensions/demo/openclaw.plugin.json",
182+"/state/extensions/demo/src/index.js",
183+"/state/node_modules/root-dep/index.js",
184+]),
183185);
184-expect(
185-entries.some((entry) => entry.endsWith("/state/node_modules/root-dep/index.js")),
186-).toBe(true);
187-expect(
188-entries.some((entry) => entry.includes("/state/extensions/demo/node_modules/")),
189-).toBe(false);
186+const pluginNodeModuleEntries = entries.filter((entry) =>
187+entry.includes("/state/extensions/demo/node_modules/"),
188+);
189+expect(pluginNodeModuleEntries).toEqual([]);
190190191191const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
192192await expect(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。