You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,7 +213,7 @@ Test files are run from their current directory, so [`process.cwd()`](https://no
213
213
214
214
### Creating tests
215
215
216
-
To create a test you call the `test` function you imported from AVA. Provide the optional title and callback function. The function will be called when your test is run. It's passed an [execution object](#t) as its first and only argument. By convention this argument is named `t`.
216
+
To create a test you call the `test` function you imported from AVA. Provide the optional title and implementation function. The function will be called when your test is run. It's passed an [execution object](#t) as its first and only argument. By convention this argument is named `t`.
217
217
218
218
```js
219
219
importtestfrom'ava';
@@ -235,7 +235,7 @@ test(t => {
235
235
236
236
It's recommended to provide test titles if you have more than one test.
237
237
238
-
If you haven't provided a test title, but the callback is a named function, that name will be used as the test title:
238
+
If you haven't provided a test title, but the implementation is a named function, that name will be used as the test title:
239
239
240
240
```js
241
241
test(functionname(t) {
@@ -366,7 +366,7 @@ Match titles starting with `foo` or ending with `bar`:
366
366
$ ava --match='foo*' --match='*bar'
367
367
```
368
368
369
-
Note that a match pattern takes precedence over the `.only` modifier. Only tests with an explicit title are matched. Tests without titles or whose title is derived from the callback function will be skipped when `--match` is used.
369
+
Note that a match pattern takes precedence over the `.only` modifier. Only tests with an explicit title are matched. Tests without titles or whose title is derived from the implementation function will be skipped when `--match` is used.
370
370
371
371
Here's what happens when you run AVA with a match pattern of `*oo*` and the following tests:
372
372
@@ -404,11 +404,11 @@ test.skip('will not be run', t => {
404
404
});
405
405
```
406
406
407
-
You must specify the callback function.
407
+
You must specify the implementation function.
408
408
409
409
### Test placeholders ("todo")
410
410
411
-
You can use the `.todo` modifier when you're planning to write a test. Like skipped tests these placeholders are shown in the output. They only require a title; you cannot specify the callback function.
411
+
You can use the `.todo` modifier when you're planning to write a test. Like skipped tests these placeholders are shown in the output. They only require a title; you cannot specify the implementation function.
412
412
413
413
```js
414
414
test.todo('will think about writing this later');
@@ -698,24 +698,24 @@ $ ava --timeout=100 # 100 milliseconds
698
698
699
699
## API
700
700
701
-
### `test([title], callback)`
702
-
### `test.serial([title], callback)`
703
-
### `test.cb([title], callback)`
704
-
### `test.only([title], callback)`
705
-
### `test.skip([title], callback)`
701
+
### `test([title], implementation)`
702
+
### `test.serial([title], implementation)`
703
+
### `test.cb([title], implementation)`
704
+
### `test.only([title], implementation)`
705
+
### `test.skip([title], implementation)`
706
706
### `test.todo(title)`
707
-
### `test.before([title], callback)`
708
-
### `test.after([title], callback)`
709
-
### `test.beforeEach([title], callback)`
710
-
### `test.afterEach([title], callback)`
707
+
### `test.before([title], implementation)`
708
+
### `test.after([title], implementation)`
709
+
### `test.beforeEach([title], implementation)`
710
+
### `test.afterEach([title], implementation)`
711
711
712
712
#### `title`
713
713
714
714
Type: `string`
715
715
716
716
Test title.
717
717
718
-
#### `callback(t)`
718
+
#### `implementation(t)`
719
719
720
720
Type: `function`
721
721
@@ -725,7 +725,7 @@ Should contain the actual test.
725
725
726
726
Type: `object`
727
727
728
-
The execution object of a particular test. Each test callback receives a different object. Contains the [assertions](#assertions) as well as `.plan(count)` and `.end()` methods. `t.context` can contain shared state from `beforeEach` hooks.
728
+
The execution object of a particular test. Each test implementation receives a different object. Contains the [assertions](#assertions) as well as `.plan(count)` and `.end()` methods. `t.context` can contain shared state from `beforeEach` hooks.
729
729
730
730
###### `t.plan(count)`
731
731
@@ -737,7 +737,7 @@ End the test. Only works with `test.cb()`.
737
737
738
738
## Assertions
739
739
740
-
Assertions are mixed into the [execution object](#t) provided to each test callback:
740
+
Assertions are mixed into the [execution object](#t) provided to each test implementation:
0 commit comments