mirror of
https://github.com/sstephenson/bats.git
synced 2024-11-17 11:42:33 +01:00
Make an ordered list out of the initial brief description.
parent
a1ab05353d
commit
805890a95b
|
@ -1,8 +1,8 @@
|
||||||
In order to better understand what you can and can't do outside of `test` blocks, it's important to know how Bats processes test files. Below is a walkthrough by Sam:
|
In order to better understand what you can and can't do outside of `test` blocks, it's important to know how Bats processes test files. Below is a walkthrough by Sam:
|
||||||
|
|
||||||
First, each test file is preprocessed. This essentially amounts to replacing lines like `@test "first test" {` with `test_first_test() { bats_begin_test "first test";`, i.e. turning each `@test` block into a test function.
|
1. First, each test file is preprocessed. This essentially amounts to replacing lines like `@test "first test" {` with `test_first_test() { bats_begin_test "first test";`, i.e. turning each `@test` block into a test function.
|
||||||
|
|
||||||
Then, each test file is executed n+1 times, where n is the number of test cases in the file.
|
1. Then, each test file is executed n+1 times, where n is the number of test cases in the file.
|
||||||
|
|
||||||
The first run evaluates the file without running any test functions, counting all the test cases in the file. If you invoke bats with `-c`, execution ends here; otherwise, the first run prints out the TAP header `(1..n)`, then iterates over the test cases and executes each one in a new child process.
|
The first run evaluates the file without running any test functions, counting all the test cases in the file. If you invoke bats with `-c`, execution ends here; otherwise, the first run prints out the TAP header `(1..n)`, then iterates over the test cases and executes each one in a new child process.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user