Skip to content

Make the content of a mismatched expectation part of the error output #199

@filmil

Description

@filmil

Suppose I have this test, copy-pasted from README.md and changed so that it fails.

#!/usr/bin/env bats

@test "addition using bc" {
  result="$(echo 2+2 | bc)"
  [ "$result" -eq 5 ]
}

When a test fails, I would really prefer to have the test fixture what happened. Here it will just tell me that the line [ "$result -eq 5 ] failed, but won't tell me what the content of $result is.

This makes bats test failures more difficult to debug than necessary. I mean yes, test are useful when they pass, but they are really useful when they are helpful when they fail.

Any plans to make things be different, or do you expect people to roll their own or use a separate xUnit-like library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions