mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-03 06:35:49 +00:00
fix(tests): skip the inert OpenCode stub when loading plugin factories
This commit is contained in:
1 file changed
+2
-1
@@ -40,7 +40,8 @@ try {
|
||||
const loaded = [];
|
||||
for (const name of fs.readdirSync(path.join(root, 'plugins')).filter(name => /\\.ts$/.test(name))) {
|
||||
const mod = await import(pathToFileURL(path.join(root, 'plugins', name)).href);
|
||||
for (const entry of new Set(Object.values(mod))) loaded.push(await entry(context));
|
||||
// The inert stub is a V2 definition object, not a factory: it registers no hooks.
|
||||
for (const entry of new Set(Object.values(mod))) loaded.push(typeof entry === 'function' ? await entry(context) : {});
|
||||
}
|
||||
const live = loaded.filter(hooks => typeof hooks['tool.execute.after'] === 'function');
|
||||
assert.equal(live.length, 1, 'Local discovery must register exactly one live ECC plugin');
|
||||
|
||||
Reference in new issue
Block a user