Expand existing BATS Test Suite to cover every feature#109
Merged
stefanzweifel merged 12 commits intomasterfrom Oct 11, 2020
Merged
Expand existing BATS Test Suite to cover every feature#109stefanzweifel merged 12 commits intomasterfrom
stefanzweifel merged 12 commits intomasterfrom
Conversation
2 tasks
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.
This PR builds upon #100 and expands the existing test suite written with bats to cover every feature of git-auto-commit.
It's the first time I ever wrote tests for shell scripts, so apologies if the code isn't perfect. We're all learning here. 😅
The tests are probably a bit too tightly coupled to the implementation. The tests are basically just validating the the right output is displayed and the right
git-commands are called with the right options.Despite the coupling, I think this is a good first version to get the confidence that changes don't break the Action.
(It was honestly the biggest concern I always had when a PR has been opened)
Writing tests in bats can be quite confusing or overwhelming for new contributors.
I plan to write a little guide on how to get started with
batsandshellmocksoon.Update: I've written a "Getting started with Bash Testing" Guide here: https://stefanzweifel.io/posts/2020/12/22/getting-started-with-bash-testing-with-bats/