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

Show Why Tests Have Failed #271

@JimLynchCodes

Description

@JimLynchCodes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions