Skip to content

Commit e464032

Browse files
Merge branch 'main' into strictmode
# Conflicts: # CHANGELOG.md
2 parents 6884e4c + 1b1ff46 commit e464032

27 files changed

+532
-915
lines changed

.editorconfig

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,25 @@ end_of_line = lf
55
insert_final_newline = true
66
charset = utf-8
77
trim_trailing_whitespace = true
8-
9-
[**.sh]
108
indent_style = space
119
indent_size = 2
10+
11+
[**.sh]
1212
max_line_length = 120
1313

1414
[**.md]
15-
indent_style = space
1615
indent_size = 4
1716

1817
[**.ts]
19-
indent_style = space
20-
indent_size = 2
2118
max_line_length = 120
2219

2320
[**.css]
24-
indent_style = space
25-
indent_size = 2
2621
max_line_length = 120
2722

28-
[**.json]
29-
indent_style = space
30-
indent_size = 2
31-
3223
[docs/**.md] # YAML support
3324
indent_size = 2
3425

35-
[{Makefile,**.mk}]
26+
[{Makefile,**.mk,.git*}]
3627
indent_style = tab
3728

3829
[{tests/acceptance/**.sh,src/console_header.sh}]

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Changelog
22

3-
## [Unreleased](https://github.com/TypedDevs/bashunit/compare/0.10.1...main)
3+
## [Unreleased](https://github.com/TypedDevs/bashunit/compare/0.11.0...main)
4+
5+
- Support tests written using Bash's errexit (-e), nounset (-u), and pipefail options ("unofficial strict mode").
6+
7+
## [0.11.0](https://github.com/TypedDevs/bashunit/compare/0.10.1...0.11.0) - 2024-03-02
48

59
- Add `--upgrade` option to `./bashunit`
610
- Remove support to deprecated `setUp`, `tearDown`, `setUpBeforeScript` and `tearDownAfterScript` functions
711
- Optimize test execution time
8-
- Support tests written using Bash's errexit (-e), nounset (-u), and pipefail options ("unofficial strict mode").
12+
- Test functions are now run in the order they're defined in a test file
13+
- Increase contrast of test results
914

1015
## [0.10.1](https://github.com/TypedDevs/bashunit/compare/0.10.0...0.10.1) - 2023-11-13
1116

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ endif
3737

3838
help:
3939
@echo ""
40-
@echo "usage: make COMMAND"
40+
@echo "Usage: make [command]"
4141
@echo ""
4242
@echo "Commands:"
43-
@echo " test Run the test"
44-
@echo " test/list List all the test under the tests directory"
45-
@echo " test/watch Automatically run the test every second"
46-
@echo " env/example Makes a copy of the keys on your .env file"
47-
@echo " pre_commit/install Installs the pre-commit hook"
48-
@echo " pre_commit/run Function that will be called when the pre-commit runs"
43+
@echo " test Run the tests"
44+
@echo " test/list List all tests under the tests directory"
45+
@echo " test/watch Automatically run tests every second"
46+
@echo " env/example Copy variables without the values from .env into .env.example"
47+
@echo " pre_commit/install Install the pre-commit hook"
48+
@echo " pre_commit/run Function that will be called when the pre-commit hook runs"
4949
@echo " sa Run shellcheck static analysis tool"
5050
@echo " lint Run editorconfig linter tool"
5151

@@ -68,25 +68,25 @@ test/watch: $(TEST_SCRIPTS)
6868
@fswatch -m poll_monitor -or $(SRC_SCRIPTS_DIR) $(TEST_SCRIPTS_DIR) .env Makefile | xargs -n1 ./bashunit $(TEST_SCRIPTS)
6969

7070
env/example:
71-
@echo "Copy the .env into the .env.example file without the values"
71+
@echo "Copying variables without the values from .env into .env.example"
7272
@sed 's/=.*/=/' .env > .env.example
7373

7474
pre_commit/install:
75-
@echo "Installing pre-commit hooks"
75+
@echo "Installing pre-commit hook"
7676
cp $(PRE_COMMIT_SCRIPTS_FILE) $(GIT_DIR)/hooks/
7777

7878
pre_commit/run: test sa lint env/example
7979

8080
sa:
8181
ifndef STATIC_ANALYSIS_CHECKER
82-
@printf "\e[1m\e[31m%s\e[0m\n" "Shellcheck not installed: Static analisys not preformed!" && exit 1
82+
@printf "\e[1m\e[31m%s\e[0m\n" "Shellcheck not installed: Static analysis not performed!" && exit 1
8383
else
8484
@shellcheck ./**/*.sh -C && printf "\e[1m\e[32m%s\e[0m\n" "ShellCheck: OK!"
8585
endif
8686

8787
lint:
8888
ifndef LINTER_CHECKER
89-
@printf "\e[1m\e[31m%s\e[0m\n" "Editorconfig not installed: Lint not preformed!" && exit 1
89+
@printf "\e[1m\e[31m%s\e[0m\n" "Editorconfig not installed: Lint not performed!" && exit 1
9090
else
9191
@ec -config .editorconfig && printf "\e[1m\e[32m%s\e[0m\n" "editorconfig-check: OK!"
9292
endif

bashunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
# shellcheck disable=SC2034
5-
declare -r BASHUNIT_VERSION="0.10.1"
5+
declare -r BASHUNIT_VERSION="0.11.0"
66

77
readonly BASHUNIT_ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"
88
export BASHUNIT_ROOT_DIR

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
mkdir -p bin
44

5-
cat src/*.sh > bin/temp.sh
5+
echo '#!/usr/bin/env bash' > bin/temp.sh
6+
7+
cat src/*.sh >> bin/temp.sh
68
cat bashunit >> bin/temp.sh
79
grep -v '^source' bin/temp.sh > bin/bashunit
810
rm bin/temp.sh

docs/command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Arguments:
150150
Specifies the directory or file containing [...]
151151
152152
Options:
153-
-f|--filer
153+
-f|--filter
154154
Filters the tests to run based on the test name.
155155
156156
[...]

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# shellcheck disable=SC2164
44
# shellcheck disable=SC2103
55

6-
declare -r LATEST_BASHUNIT_VERSION="0.10.1"
6+
declare -r LATEST_BASHUNIT_VERSION="0.11.0"
77

88
DIR=${1-lib}
99
VERSION=${2-latest}

0 commit comments

Comments
 (0)