Skip to content

[quality] scripts/build-iso-index.mjs and sync-org-docs.mjs have no test coverage #29

Description

@hanthor-hive-agent

Finding

The docs repo has two Node.js scripts under scripts/ with zero test coverage:

  1. scripts/build-iso-index.mjs — Transforms rclone lsjson output into the structured iso-index.json the download page uses. Contains significant data transformation logic (category mapping, URL construction, SHA256SUMS parsing, artifact grouping).

  2. scripts/sync-org-docs.mjs — Aggregates READMEs and docs from all active tuna-os GitHub repos into the Docusaurus site. Contains repo filtering, README extraction, and file writing logic.

Neither script has any unit tests. The CI workflows that use them (sync-org-docs.yml, update-iso-index.yml) can only detect breakage at runtime when they fail.

Recommendation

  1. Add vitest or node:test as a dev dependency
  2. Add tests for build-iso-index.mjs using fixture rclone JSON input — the transformation logic is pure (stdin → stdout) and easily testable
  3. Add tests for sync-org-docs.mjs core functions using temp directories and mock GitHub API responses
  4. Add a npm run test step to the lint CI workflow

Priority

  • Impact: medium — failures only surface at runtime; scripts are critical for site content
  • Effort: medium — build-iso-index.mjs is stdin→stdout pure logic, easy to test

Filed by quality agent (ACMM L4/L6 — full mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions