Skip to content

test(docs): cover catalog parsing helpers - #345

Open
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:test/sync-catalog-parsing
Open

test(docs): cover catalog parsing helpers#345
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:test/sync-catalog-parsing

Conversation

@ikenyal

@ikenyal ikenyal commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Problem

Issue #, if available: #323

The catalog sync gate exercises scripts/sync-catalog.mjs only as a CLI command. Its parsing helpers have no direct tests, so a regression in blurb extraction or marker handling could silently corrupt the committed catalog or weaken the CI check.

Changes

  • Make the pure catalog helpers importable without running the CLI.
  • Add table-driven coverage for extractBlurb, extractBetweenMarkers, and injectCatalog, including malformed marker order and missing-marker behavior.
  • Run the new tests in the existing Block Catalog Check workflow before the catalog freshness check.

No published package behavior changes, so no changeset is needed.

This intentionally follows the narrow scope proposed in #323. If the maintainers would prefer a different test location, helper extraction, or scope, I am happy to adjust this PR or close it.

Validation

  • node --test scripts/*.test.mjs (45 passing)
  • node scripts/sync-catalog.mjs --check
  • node scripts/sync-catalog.mjs --write (no README changes)
  • git diff --check

npm run build could not run in this dedicated worktree because its workspace dependencies are not installed (tsc is unavailable). The changed script and its CI workflow use Node built-ins only; the targeted checks above exercise the complete changed behavior.

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is unchanged; this is a test and CI-only change

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1d0f19d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant