Skip to content

Commit 23ac30d

Browse files
committed
add some missing docs
1 parent 186fd78 commit 23ac30d

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

readme.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,21 @@ test.serial(t => {
181181
});
182182
```
183183

184+
### Skipped tests
185+
186+
Skipped tests are shown in the output as skipped, but never run.
187+
188+
```js
189+
test.skip('unicorn', t => {
190+
t.end();
191+
});
192+
```
193+
184194
### Before & after hooks
185195

186196
When setup and/or teardown is required, you can use `test.before()` and `test.after()`,
187-
used in the same manner as `test()`. The test function given to `test.before()` and `test.after()` is called before/after all tests. You can also use `test.beforeEach()` and `test.afterEach()` if you need setup/teardown for each test. Hooks are run serially in the test file. Add as many of these as you want.
197+
used in the same manner as `test()`. The test function given to `test.before()` and `test.after()` is called before/after all tests. You can also use `test.beforeEach()` and `test.afterEach()` if you need setup/teardown for each test. Hooks are run serially in the test file. Add as many of these as you want. You can optionally specify a title that is shown on failure.
198+
188199

189200
```js
190201
test.before(t => {
@@ -197,7 +208,7 @@ test.before(t => {
197208
t.end();
198209
});
199210

200-
test.after(t => {
211+
test.after('cleanup', t => {
201212
// this runs after all tests
202213
t.end();
203214
});
@@ -331,16 +342,19 @@ test(async t => {
331342

332343
## API
333344

334-
### test([name], body)
335-
### test.serial([name], body)
336-
### test.before(body)
337-
### test.after(body)
345+
### test([title], body)
346+
### test.serial([title], body)
347+
### test.skip([title], body)
348+
### test.before([title], body)
349+
### test.after([title], body)
350+
### test.beforeEach([title], body)
351+
### test.afterEach([title], body)
338352

339-
#### name
353+
#### title
340354

341355
Type: `string`
342356

343-
Test name.
357+
Test title.
344358

345359
#### body(context)
346360

0 commit comments

Comments
 (0)