Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Show Why Tests Have Failed #271

Open
JimLynchCodes opened this issue Feb 1, 2020 · 1 comment
Open

Show Why Tests Have Failed #271

JimLynchCodes opened this issue Feb 1, 2020 · 1 comment

Comments

@JimLynchCodes
Copy link

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! ❤️

@stefanlasiewski
Copy link

stefanlasiewski commented Feb 5, 2020

FYI, this project is no longer maintained. Please give it's successor a try:

https://github.com/bats-core/bats-core

jasonkarns added a commit to jasonkarns/bats that referenced this issue Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants