Files
Ghazi ee4c37f65a refactor(tests): extract Mega Integration Test, delete failsafe
The legacy `tests/failsafe.test.mjs` was a 546-line behemoth
that duplicated work `pnpm prep` already did:
  - `pnpm install`
  - `pnpm run build`
  - `npx tsc --noEmit` (already in the build step)
  - `tools/security-audit.mjs`
  - engine loader smoke tests

It ran AFTER the categorised suite as a separate step, giving
prep a confusing two-stage test flow with mixed TUI styles.

Extracted the one unique piece — the Mega Integration Test
that exercises workspaces + i18n + versioning + plugins in a
single build — into `tests/mega-integration.test.js`, using the
shared helpers from `tests/shared.js`. The 23 assertions cover:

  - Main project root + guide page
  - API project index + endpoints
  - French locale index + guide
  - v1 index present, v1/guide absent
  - Generated artefacts: search-index, sitemap, llms.txt,
    llms-full.txt, PWA manifest, service worker
  - Plugin content: sitemap URLs, llms.txt links, math katex,
    mermaid <div>, SEO meta tags, custom assets

Removed:
  - `tests/failsafe.test.mjs` (deleted)
  - Failsafe step in `tools/prep.js`
  - Failsafe mention in the header comment

Added:
  - `tests/mega-integration.test.js` (new)
  - `tests/package.json` (`{"type": "module"}`) — silences the
    `MODULE_TYPELESS_PACKAGE_JSON` warnings for runner.js,
    shared.js, security.test.js, feature-integration.test.js,
    and the new mega-integration.test.js. Without this, Node
    reparses them as ESM after a CJS failure, with a perf hit.

Result:
  Before: 342 assertions across 9 files + failsafe (22/22, dup work)
  After:  365 assertions across 10 files, single `pnpm prep` pass

Test suite breakdown in the runner:
  cli-contracts/exit-codes           (7)
  cli-contracts/plugin-add-remove    (9)
  cli-contracts/validate-workspace   (6)
  parser/test/container-normaliser   (60)
  utils/{path,html-escape}           (31)
  brute-test-security                (88)
  brute-test (feature-integration)   (114)
  plugin-okf tests                   (21)
  plugin-llms tests                  (6)
  mega-integration                   (23) ← new
2026-06-25 00:35:52 +05:30

3 lines
22 B
JSON