diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d2a7c88..07307b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Improved output: adding a space between each test file + ## [0.18.0](https://github.com/TypedDevs/bashunit/compare/0.17.0...0.18.0) - 2024-10-16 - Added `-p|--parallel` to enable running tests in parallel diff --git a/src/console_results.sh b/src/console_results.sh index f1783663..1429c227 100644 --- a/src/console_results.sh +++ b/src/console_results.sh @@ -12,7 +12,9 @@ function console_results::render_result() { return 1 fi - echo "" + if env::is_simple_output_enabled; then + printf "\n\n" + fi local total_tests=0 ((total_tests += $(state::get_tests_passed))) || true @@ -262,7 +264,10 @@ function console_results::print_failing_tests_and_reset() { local total_failed total_failed=$(state::get_tests_failed) - echo "" + if env::is_simple_output_enabled; then + printf "\n\n" + fi + if [[ "$total_failed" -eq 1 ]]; then echo -e "${_COLOR_BOLD}There was 1 failure:${_COLOR_DEFAULT}\n" else @@ -271,5 +276,7 @@ function console_results::print_failing_tests_and_reset() { sed '${/^$/d;}' "$FAILURES_OUTPUT_PATH" | sed 's/^/|/' rm "$FAILURES_OUTPUT_PATH" + + echo "" fi } diff --git a/src/runner.sh b/src/runner.sh index 727e1377..764b82b8 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -105,6 +105,10 @@ function runner::call_test_functions() { done unset function_name done + + if ! env::is_simple_output_enabled; then + echo "" + fi } function runner::render_running_file_header() { diff --git a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot index e0c51a9a..474df364 100644 --- a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot +++ b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot @@ -1,6 +1,7 @@ Running ./tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty + Running ./tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot index e0c51a9a..474df364 100644 --- a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot +++ b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot @@ -1,6 +1,7 @@ Running ./tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty + Running ./tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_env.snapshot b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_env.snapshot index 3d4daf1d..da114271 100644 --- a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_env.snapshot @@ -1,4 +1,5 @@ .... + Tests:  4 passed, 4 total Assertions: 6 passed, 6 total diff --git a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_option.snapshot b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_option.snapshot index 3d4daf1d..da114271 100644 --- a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_simple_output_option.snapshot @@ -1,4 +1,5 @@ .... + Tests:  4 passed, 4 total Assertions: 6 passed, 6 total diff --git a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_argument_overloads_default_path.snapshot b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_argument_overloads_default_path.snapshot index e0ec79df..3fc304ab 100644 --- a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_argument_overloads_default_path.snapshot +++ b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_argument_overloads_default_path.snapshot @@ -1,4 +1,3 @@ - Tests:  0 total Assertions: 0 total diff --git a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot index 1a618d8c..c43659c8 100644 --- a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot +++ b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot @@ -1,6 +1,7 @@ Running tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty + Running tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot index 1a618d8c..c43659c8 100644 --- a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot +++ b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot @@ -1,6 +1,7 @@ Running tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty + Running tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot index 250bb252..4b7f2bd4 100644 --- a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot @@ -5,7 +5,6 @@ but got  '2' Stop on failure enabled... - There was 1 failure: |1) ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh diff --git a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot index 250bb252..4b7f2bd4 100644 --- a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot @@ -5,7 +5,6 @@ but got  '2' Stop on failure enabled... - There was 1 failure: |1) ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh