You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
task: support tests/ and __tests__/ and remove dead root jest.config.js #3469
npm test uses .jest.config.cjs, whose testMatch already covers **/tests/**/*.test.{js,ts,mjs} and **/__tests__/**/*.test.{js,ts,mjs}. Jest 30.5.2 is installed (current stable 30.5).
Root jest.config.js targets agents/changelog/tests/, which no longer exists (the agent is agents/changelog-agent/). It is dead.
Root AGENTS.md requires tests in a matching __tests__/ subtree; spec 014 requires tests/. 17 agents use tests/, 10 use __tests__/.
The Jest config proposed in the consolidation guide targets .github/agents/*/tests/ (wrong path for this repo) and drops __tests__/; do not adopt it.
Change
Allow both tests/ and __tests__/; document it once in root AGENTS.md and spec 014.
Delete root jest.config.js or point it at .jest.config.cjs.
Additional finding: the Jest harness cannot run native-ESM suites under scripts/validation/__tests__/.
npx jest --config .jest.config.cjs scripts/validation/__tests__/structure-validation.test.js fails with "Must use import to load ES Module" (suite never loads).
With NODE_OPTIONS=--experimental-vm-modules the suite loads, but all 9 tests fail with "StructureChecker is not a constructor" / "PackageJsonValidator is not a constructor": Babel transforms the test to CommonJS while the libraries load as ESM, so the default import is the module namespace.
Fix options: set "type": "module" in scripts/validation/package.json with an ESM-aware Jest setup, or disable module transformation (modules: false) for those paths. Until then these suites give no signal in npm test.
Correction to my previous comment: the loading failure was caused by the test file itself, not the Jest harness. structure-validation.test.js used import.meta, which Babel cannot transform to CommonJS. Commit 334c1d1 on #3434 replaced it, and the suites now load and pass under the existing .jest.config.cjs (17/17 across structure-validation, skills-registry-validator and skills-registry, both with and without --experimental-vm-modules).
Remaining point for this issue: any other test that uses import.meta under scripts/ will hit the same error; either avoid it in tests or move those suites to native ESM.
Partly addressed by #3711 (merged as 907442298): the broken root jest.config.js is deleted and a root jest.config.cjs now forwards to .jest.config.cjs, so bare npx jest resolves the intended configuration. Measured on the merged tree: bare npx jest --listTests and npx jest --config .jest.config.cjs --listTests both list 315 files and the lists are identical; the full suite passes (315 suites, 6,969 passed, 0 failed). This took the "point it at .jest.config.cjs" option from this issue's change section. The tests/ and __tests__/ support part of this issue is not changed by #3711 and remains open.
Activity
linear-code commentedon Sep 23, 2026
LS-4234
eleshar commentedon Sep 23, 2026
Additional finding: the Jest harness cannot run native-ESM suites under
scripts/validation/__tests__/.npx jest --config .jest.config.cjs scripts/validation/__tests__/structure-validation.test.jsfails with "Must use import to load ES Module" (suite never loads).NODE_OPTIONS=--experimental-vm-modulesthe suite loads, but all 9 tests fail with "StructureChecker is not a constructor" / "PackageJsonValidator is not a constructor": Babel transforms the test to CommonJS while the libraries load as ESM, so the default import is the module namespace.Fix options: set
"type": "module"inscripts/validation/package.jsonwith an ESM-aware Jest setup, or disable module transformation (modules: false) for those paths. Until then these suites give no signal innpm test.eleshar commentedon Sep 23, 2026
Correction to my previous comment: the loading failure was caused by the test file itself, not the Jest harness.
structure-validation.test.jsusedimport.meta, which Babel cannot transform to CommonJS. Commit334c1d1on #3434 replaced it, and the suites now load and pass under the existing.jest.config.cjs(17/17 acrossstructure-validation,skills-registry-validatorandskills-registry, both with and without--experimental-vm-modules).Remaining point for this issue: any other test that uses
import.metaunderscripts/will hit the same error; either avoid it in tests or move those suites to native ESM.eleshar commentedon Oct 3, 2026
Partly addressed by #3711 (merged as
907442298): the broken rootjest.config.jsis deleted and a rootjest.config.cjsnow forwards to.jest.config.cjs, so barenpx jestresolves the intended configuration. Measured on the merged tree: barenpx jest --listTestsandnpx jest --config .jest.config.cjs --listTestsboth list 315 files and the lists are identical; the full suite passes (315 suites, 6,969 passed, 0 failed). This took the "point it at.jest.config.cjs" option from this issue's change section. Thetests/and__tests__/support part of this issue is not changed by #3711 and remains open.