Skip to content

Expand existing BATS Test Suite to cover every feature#109

Merged
stefanzweifel merged 12 commits intomasterfrom
improve-testsuite
Oct 11, 2020
Merged

Expand existing BATS Test Suite to cover every feature#109
stefanzweifel merged 12 commits intomasterfrom
improve-testsuite

Conversation

@stefanzweifel
Copy link
Copy Markdown
Owner

@stefanzweifel stefanzweifel commented Oct 11, 2020

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 bats and shellmock soon.

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/

@stefanzweifel stefanzweifel merged commit fc5b9bf into master Oct 11, 2020
@stefanzweifel stefanzweifel deleted the improve-testsuite branch October 11, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant