mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-11 18:53:11 +08:00
test: keep stable backport assertions scoped
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const assert = require('assert');
|
||||
const { INLINE_RESOLVE } = require('../../scripts/lib/resolve-ecc-root');
|
||||
|
||||
let passed = 0;
|
||||
let failed = 0;
|
||||
@@ -20,24 +19,8 @@ function test(name, fn) {
|
||||
}
|
||||
}
|
||||
|
||||
const sessionsDoc = fs.readFileSync(path.join(__dirname, '..', '..', 'commands', 'sessions.md'), 'utf8');
|
||||
const skillHealthDoc = fs.readFileSync(path.join(__dirname, '..', '..', 'commands', 'skill-health.md'), 'utf8');
|
||||
const instinctStatusDoc = fs.readFileSync(path.join(__dirname, '..', '..', 'commands', 'instinct-status.md'), 'utf8');
|
||||
|
||||
test('sessions command uses shared inline resolver in all node scripts', () => {
|
||||
assert.strictEqual((sessionsDoc.match(/const _r = /g) || []).length, 6);
|
||||
assert.strictEqual((sessionsDoc.match(/\['marketplaces','ecc'\]/g) || []).length, 6);
|
||||
assert.strictEqual((sessionsDoc.match(/\['marketplaces','everything-claude-code'\]/g) || []).length, 6);
|
||||
assert.strictEqual((sessionsDoc.match(/\['ecc','everything-claude-code'\]/g) || []).length, 6);
|
||||
});
|
||||
|
||||
test('skill-health command uses shared inline resolver in all shell snippets', () => {
|
||||
assert.strictEqual((skillHealthDoc.match(/var r=/g) || []).length, 3);
|
||||
assert.strictEqual((skillHealthDoc.match(/\['marketplaces','ecc'\]/g) || []).length, 3);
|
||||
assert.strictEqual((skillHealthDoc.match(/\['marketplaces','everything-claude-code'\]/g) || []).length, 3);
|
||||
assert.strictEqual((skillHealthDoc.match(/\['ecc','everything-claude-code'\]/g) || []).length, 3);
|
||||
});
|
||||
|
||||
test('instinct-status command uses shared inline resolver (no stale legacy fallback) (#2037)', () => {
|
||||
assert.strictEqual((instinctStatusDoc.match(/var r=/g) || []).length, 1);
|
||||
assert.strictEqual((instinctStatusDoc.match(/\['marketplaces','ecc'\]/g) || []).length, 1);
|
||||
@@ -51,12 +34,6 @@ test('instinct-status command uses shared inline resolver (no stale legacy fallb
|
||||
);
|
||||
});
|
||||
|
||||
test('inline resolver covers current and legacy marketplace plugin roots', () => {
|
||||
assert.ok(INLINE_RESOLVE.includes("'marketplaces','ecc'"));
|
||||
assert.ok(INLINE_RESOLVE.includes("'marketplaces','everything-claude-code'"));
|
||||
assert.ok(!INLINE_RESOLVE.includes('\\"'), 'Inline resolver should not require escaped double quotes');
|
||||
});
|
||||
|
||||
console.log(`Passed: ${passed}`);
|
||||
console.log(`Failed: ${failed}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user