Skip to content

Commit

Permalink
[DOCS] Document // TEARDOWN test snippet. (#44762)
Browse files Browse the repository at this point in the history
The `// TEARDOWN` test snippet was added with #34716. You can use this
snippet to end and clean up a test series started with `// TESTSETUP` or
`// TEST[setup:name]`.
  • Loading branch information
jrodewig committed Jul 23, 2019
1 parent c03fea3 commit b506955
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ for its modifiers:
This is most useful when you have text and snippets that work together to
tell the story of some use case because it merges the snippets (and thus the
use case) into one big test.
* You can't use `// TEST[continued]` immediately after `// TESTSETUP` or
`// TEARDOWN`.
* `// TEST[skip:reason]`: Skip this test. Replace `reason` with the actual
reason to skip the test. Snippets without `// TEST` or `// CONSOLE` aren't
considered tests anyway but this is useful for explicitly documenting the
Expand Down Expand Up @@ -76,7 +78,11 @@ for its modifiers:
but rather than the setup defined in `docs/build.gradle` the setup is defined
right in the documentation file. In general, we should prefer `// TESTSETUP`
over `// TEST[setup:name]` because it makes it more clear what steps have to
be taken before the examples will work.
be taken before the examples will work. Tip: `// TESTSETUP` can only be used
on the first snippet of a document.
* `// TEARDOWN`: Ends and cleans up a test series started with `// TESTSETUP` or
`// TEST[setup:name]`. You can use `// TEARDOWN` to set up multiple tests in
the same file.
* `// NOTCONSOLE`: Marks this snippet as neither `// CONSOLE` nor
`// TESTRESPONSE`, excluding it from the list of unconverted snippets. We
should only use this for snippets that *are* JSON but are *not* responses or
Expand Down

0 comments on commit b506955

Please sign in to comment.