$BATS_TEST_NAME  –  Function Name of Test

$BATS_TEST_NAME is the name of the function containing the current test case.

Examples

Print name of current test function
1
2
3
@test "Example" {
  echo "Function name: $BATS_TEST_NAME" >&3
}
BashSupport Pro is a shell script IDE with support for bats-core’s $BATS_TEST_NAMEtry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal