

























@@ -35,6 +35,10 @@ function codexConfig(): OpenClawConfig {
3535} as OpenClawConfig;
3636}
373738+function hasAsset(hits: Array<{ kind: string; path: string }>, kind: string, assetPath: string) {
39+return hits.some((hit) => hit.kind === kind && hit.path === assetPath);
40+}
41+3842afterEach(async () => {
3943for (const root of tempRoots) {
4044await fs.rm(root, { recursive: true, force: true });
@@ -70,29 +74,21 @@ describe("scanCodexNativeAssets", () => {
7074env: { CODEX_HOME: codexHome, HOME: root },
7175});
727673-expect(hits).toEqual(
74-expect.arrayContaining([
75-{ kind: "skill", path: path.join(codexHome, "skills", "tweet-helper") },
76-{ kind: "skill", path: path.join(root, ".agents", "skills", "agent-helper") },
77-{
78-kind: "plugin",
79-path: path.join(
80-codexHome,
81-"plugins",
82-"cache",
83-"openai-primary-runtime",
84-"documents",
85-"1.0.0",
86-),
87-},
88-{ kind: "config", path: path.join(codexHome, "config.toml") },
89-{ kind: "hooks", path: path.join(codexHome, "hooks", "hooks.json") },
90-]),
77+expect(hasAsset(hits, "skill", path.join(codexHome, "skills", "tweet-helper"))).toBe(true);
78+expect(hasAsset(hits, "skill", path.join(root, ".agents", "skills", "agent-helper"))).toBe(
79+true,
9180);
92-expect(hits).not.toEqual(
93-expect.arrayContaining([
94-{ kind: "skill", path: path.join(codexHome, "skills", ".system", "system-skill") },
95-]),
81+expect(
82+hasAsset(
83+hits,
84+"plugin",
85+path.join(codexHome, "plugins", "cache", "openai-primary-runtime", "documents", "1.0.0"),
86+),
87+).toBe(true);
88+expect(hasAsset(hits, "config", path.join(codexHome, "config.toml"))).toBe(true);
89+expect(hasAsset(hits, "hooks", path.join(codexHome, "hooks", "hooks.json"))).toBe(true);
90+expect(hasAsset(hits, "skill", path.join(codexHome, "skills", ".system", "system-skill"))).toBe(
91+false,
9692);
9793});
9894此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。