TypedDevs / bashunit

A simple testing library for bash scripts. Test your bash scripts in the fastest and simplest way, discover the most modern bash testing library.
https://bashunit.typeddevs.com
MIT License
271 stars 21 forks source link

Flaky Not render execution time on osx with error code 1 #181

Open khru opened 8 months ago

khru commented 8 months ago

Summary

I run the test and everything it's ok.

I add 2 test that should fail for example:

function test_successful_assert_string_starts_with() {
  assert_empty "$(assert_string_starts_with "ho" "house")"
}

function test_unsuccessful_assert_string_starts_with() {
  assert_equals\
    "$(console_results::print_failed_test\
      "Unsuccessful assert string starts with" "pause" "to not start with" "hou")"\
    "$(assert_string_starts_with "hou" "pause")"
}

the output of the test failing is:

tests/unit/assert_test.sh: línea 211: assert_string_starts_with: orden no encontrada
✗ Failed: Unsuccessful assert string starts with
    Expected '✗ Failed: Unsuccessful assert string starts with
    Expected 'pause'
    to not start with 'hou''
    but got ''
✓ Passed: Unsuccessful assert successful code
✓ Passed: Unsuccessful return assert exit code
Running tests/unit/console_results_test.sh
✗ Failed: Not render execution time on osx with error code 1

As you may see, there is a test that should NOT be failing but it is:

✗ Failed: Not render execution time on osx with error code 1

bug

khru commented 8 months ago
 ./bashunit ./tests --simple
.................../tests/unit/assert_test.sh: línea 226: kasjdhfkjasdhf: orden no encontrada
✗ Failed: Asdfasdf
    Expected 'to not be empty'
    but got ''
................................
..✗ Failed: Not render execution time on osx with error code 1
................................................
...............................................
Tests:      147 passed, 2 failed, 149 total
Assertions: 194 passed, 1 failed, 195 total
Some tests failed
Time taken: 8487 ms