Skip to content

Commit

Permalink
install bashunit and test pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Nov 18, 2023
1 parent d8d0150 commit b8c8716
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
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
}

0 comments on commit b8c8716

Please sign in to comment.