Show Why Tests Have Failed
JimLynchCodes opened this issue · comments
Hi!
Here's a simple example of my code:
#!/usr/bin/env bash
echo "Hello, Worldy!"
and then the bats test:
#!/usr/bin/env bash
# local version: 1.1.0.0
@test "Say Hi!" {
run bash hello_world.sh
[[ $status -eq 0 ]]
[[ $output = "Hello, World!" ]]
}
I run it with bats hello_world_test.sh
, and the console output is this:
✗ Say Hi!
(in test file hello_world_test.sh, line 8)
`[[ $status -eq 0 ]]' failed
In my opinion it would be very nice if the test described WHY it has failed.
For the example above, I would think a good error message would be something like, "Expected output to be "Hello, World!", but received, "Hello Worldy!"
Thanks! ❤️
FYI, this project is no longer maintained. Please give it's successor a try: