Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

install bashunit and test pre-commit hook #307

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ charset = utf-8

[{*.yml,*.yaml}]
indent_size = 2

[*.sh]
indent_size = 2
1 change: 1 addition & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
16 changes: 16 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Tools

Here you can find developer tools to improve your DX.

### Testing

Install testing library with:
```bash
cd tools
curl -s https://bashunit.typeddevs.com/install.sh | bash -s lib 0.10.1
```

Run bash tests:
```bash
lib/bashunit tests
```
9 changes: 9 additions & 0 deletions tools/tests/pre-commit_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

function test_pre_commit() {
spy composer

"$(dirname "${BASH_SOURCE[0]}")"/../git-hooks/pre-commit.sh

assert_have_been_called_times 2 composer
}