Unit test for the cli and github action#133
Merged
Merged
Conversation
46017f6 to
a8c9921
Compare
f0d2d41 to
c95934c
Compare
5PK
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A base set of unit tests for the current state of the CLI
Interestingly, found a few typescript errors while it was building these test cases
Bugs found and fixed during test writing
src/lib/getters/filesystem/get-galleries.tsreadJsonFilereturnsnullfor malformed JSON;null.mediaGroupingIDin the dedup filter threwTypeErrorif (gallery)guard beforegalleries.push(gallery)src/lib/incremental/timestamp-tracker.tspath.join(process.cwd(), rootPath, ...)produced wrong path whenrootPathwas absolute, leaking files into the project rootpath.resolve(rootPath, ...)src/core/state.tsresetState()resetoperationTypeanddryRunbut notautoPublishstate.autoPublish = ''toresetState()src/lib/publishers/*.ts(4 files)if (!targetGuid)guard on astring[]— empty array is truthy, so guard never fired;targetGuid[0]silently becameundefinedif (!targetGuid?.length)src/lib/ui/console/logging-modes.tsvalidateLoggingStateused!state.sourceGuidand!state.locale— empty arrays are truthy so validation never caught missing GUIDs/locales!state.sourceGuid?.lengthand!state.locale?.lengthsrc/core/publish.tsPublishServiceconstructor used!state.targetGuid— same empty-array truthy issue!state.targetGuid?.lengthsrc/lib/workflows/refresh-mappings.tspath.join(process.cwd(), state.rootPath, ...)leaked log files into<project>/var/folders/...whenrootPathwas absolutepath.resolve(state.rootPath, ...)src/core/pull.ts,src/core/push.ts,src/core/state.ts(×2)path.join(process.cwd(), state.rootPath, ...)pattern inhandleResetFlagand two state path helperspath.resolve(state.rootPath, ...)