Refactor build-docs.test.ts: extract shared glob/scan/convert helper to reduce duplication #38
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/katana#38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The glob/scan/convert logic is currently copy-pasted verbatim across all 14 test cases in
packages/katana-planner-gui/scripts/build-docs.test.ts. This should be extracted into a shared helper function to reduce duplication and ensure tests exercise the realbuild-docs.tsmodule rather than a re-implemented copy.Proposed refactor
Extract a
buildDocshelper at the top of the test file:Each test then becomes a single
writeFileSync+await buildDocs(docsDir)+ assertion, with no repeated boilerplate.Context
This was flagged during review of #37 (comment: https://github.com/chris-kreidl/katana/pull/37). The refactor was deferred because
build-docs.tsdoes not exist on that branch yet — it should be addressed in a follow-up once everything from #37 is merged.Requested by @chris-kreidl.
Closing as resolved — the
build-docs.test.tsrefactor was completed in #37 after rebasing ontodocs. The tests now import and call the realbuildDocsmodule, so no further work is needed.