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

Add support for .bats.sh convention tests #200

Closed
wants to merge 1 commit into from

Conversation

ArturGajowy
Copy link

IntelliJ IDEA highlights each end of a Bats test case with an error marker when using .sh syntax highlighting, which makes Bats adoption much harder in some teams. Thus the feature proposal for supporting .bats.sh test files with a convention-based test discovery. From README.md:


Bash-compatible convention syntax

If your tools don't have built-in support for .bats syntax, you can
still use Bats with its support for .bats.sh convention tests. Each
function declaration starting with the funciton keyword is going to be
converted to a Bats test. For example, running the following test file:

#!/usr/bin/env bats

function test_using_bash_convention_syntax {
  result="$(echo 2+2 | bc)"
  [ "$result" -eq 4 ]
}

will output:

$ bats bash_addition.bats.sh
 ✓ test_using_bash_convention_syntax

1 tests, 0 failures

Test suites

You can invoke the bats interpreter with multiple test file
arguments, or with a path to a directory containing multiple .bats
and / or .bats.sh files. Bats will run each test file individually and
aggregate the results. If any test case fails, bats exits with a 1
status code.

@ArturGajowy
Copy link
Author

@sstephenson any thoughts on that? Should we merge or should we close?

@ArturGajowy
Copy link
Author

@sstephenson kindly ping :) What's your opinion on this proposal?

@xmik
Copy link

xmik commented Nov 21, 2017

Hi @ArturGajowy, this git repository is no longer maintained. It is was mirror-forked to: https://github.com/bats-core/bats-core. So if you want your PR merged, you should repoint it to bats-core.
Context:

@ArturGajowy
Copy link
Author

ArturGajowy commented Nov 21, 2017 via email

@xmik
Copy link

xmik commented Nov 21, 2017

I would also like that, but I think only @sstephenson can do that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants