Skip to content

Commit b506955

Browse files
committed
[DOCS] Document // TEARDOWN test snippet. (#44762)
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]`.
1 parent c03fea3 commit b506955

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/README.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ for its modifiers:
3131
This is most useful when you have text and snippets that work together to
3232
tell the story of some use case because it merges the snippets (and thus the
3333
use case) into one big test.
34+
* You can't use `// TEST[continued]` immediately after `// TESTSETUP` or
35+
`// TEARDOWN`.
3436
* `// TEST[skip:reason]`: Skip this test. Replace `reason` with the actual
3537
reason to skip the test. Snippets without `// TEST` or `// CONSOLE` aren't
3638
considered tests anyway but this is useful for explicitly documenting the
@@ -76,7 +78,11 @@ for its modifiers:
7678
but rather than the setup defined in `docs/build.gradle` the setup is defined
7779
right in the documentation file. In general, we should prefer `// TESTSETUP`
7880
over `// TEST[setup:name]` because it makes it more clear what steps have to
79-
be taken before the examples will work.
81+
be taken before the examples will work. Tip: `// TESTSETUP` can only be used
82+
on the first snippet of a document.
83+
* `// TEARDOWN`: Ends and cleans up a test series started with `// TESTSETUP` or
84+
`// TEST[setup:name]`. You can use `// TEARDOWN` to set up multiple tests in
85+
the same file.
8086
* `// NOTCONSOLE`: Marks this snippet as neither `// CONSOLE` nor
8187
`// TESTRESPONSE`, excluding it from the list of unconverted snippets. We
8288
should only use this for snippets that *are* JSON but are *not* responses or

0 commit comments

Comments
 (0)