test(release): add unit tests when searching for a release (#603)

* fix(release): break when draft release is found

when a release with the desired tag_name is found, break out of the loop
that looks for it. this prevents the case where accidentally overwrite a
detected release on successive iterations of the for loop

fixes: #602

* include built output

* add tests for finding tag from releases

add tests for updated functionality to break when we find a release.
the logic has been extracted into its own function, to make testing
simpler by avoiding over mocking/stubbing of network calls that would
create or update a release.

the tests that were added use jest's describe/it blocks, but use node's
assert function to align with other tests. there isn't any prior art for
mocking function calls in the codebase, so for now we use simple promises
in "mock" objects that adhere to the Releaser interface

* refactor findTagFromReleases

purely a sytlistic choice to not have to pre-declare the _release variable,
and not have to check using `typeof _release === "string"` when detecting
a found release

* reset dist/index.js to master

* update impl after merge with master

* update dist
This commit is contained in:
Ryan Waskiewicz 2025-04-18 17:29:01 -04:00 committed by GitHub
parent e2b105c98e
commit 6b18c2f260
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 287 additions and 13 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long