-
-
Notifications
You must be signed in to change notification settings - Fork 520
test(release): add unit tests when searching for a release #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chenrui333
merged 9 commits into
softprops:master
from
rwaskiewicz:rw/break-on-found-release
Apr 18, 2025
Merged
test(release): add unit tests when searching for a release #603
chenrui333
merged 9 commits into
softprops:master
from
rwaskiewicz:rw/break-on-found-release
Apr 18, 2025
Conversation
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
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: softprops#602
chenrui333
reviewed
Apr 10, 2025
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
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
chenrui333
approved these changes
Apr 18, 2025
@rwaskiewicz thanks for the work! <3 |
Gerekpann41
approved these changes
May 7, 2025
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.
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
Note: I was unsure if I should/not include an update to the build. If you're willing to accept this PR and prefer to update
dist
yourself, the build update is in a separate commit for an easygit revert
fixes: #602