1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-25 17:28:11 +01:00

Log the full stack trace when a test fails

This commit is contained in:
Sam Stephenson
2013-10-28 11:51:17 -05:00
parent c36ad10d8c
commit de1970fb8f
4 changed files with 86 additions and 3 deletions

View File

@@ -157,3 +157,11 @@ fixtures bats
[ "${lines[0]}" = "This isn't TAP!" ]
[ "${lines[1]}" = "Good day to you" ]
}
@test "failing helper function logs the test case's line number" {
run bats "$FIXTURE_ROOT/failing_helper.bats"
[ $status -eq 1 ]
[ "${lines[1]}" = "not ok 1 failing helper function" ]
[ "${lines[2]}" = "# (from function \`failing_helper' in file $FIXTURE_ROOT/test_helper.bash, line 6," ]
[ "${lines[3]}" = "# in test file $FIXTURE_ROOT/failing_helper.bats, line 5)" ]
}

View File

@@ -0,0 +1,6 @@
load "test_helper"
@test "failing helper function" {
true
failing_helper
}

View File

@@ -1,3 +1,7 @@
help_me() {
true
}
failing_helper() {
false
}