Skip to content

Commit d4aacac

Browse files
committed
Update filter CLI option docs (v29.1). Related to issue #13222
1 parent bcf649f commit d4aacac

File tree

1 file changed

+4
-2
lines changed
  • website/versioned_docs/version-29.1

1 file changed

+4
-2
lines changed

website/versioned_docs/version-29.1/CLI.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,13 @@ Alias: `-e`. Use this flag to show full diffs and errors instead of a patch.
202202

203203
### `--filter=<file>`
204204

205-
Path to a module exporting a filtering function. This asynchronous function receives a list of test paths which can be manipulated to exclude tests from running by returning an object with the "filtered" property. Especially useful when used in conjunction with a testing infrastructure to filter known broken, e.g.
205+
Path to a module exporting a filtering function. This asynchronous function receives a list of test paths which can be manipulated to exclude tests from running by returning an object with shape `{ filtered: Array<{ test: string }> }`. Especially useful when used in conjunction with a testing infrastructure to filter known broken tests, e.g.
206206

207207
```js title="my-filter.js"
208208
module.exports = testPaths => {
209-
const allowedPaths = testPaths.filter(filteringFunction); // ["path1.spec.js", "path2.spec.js", etc]
209+
const allowedPaths = testPaths.filter(filteringFunction)
210+
.map(test => ({ test })); // [{ test: "path1.spec.js" }, { test: "path2.spec.js" }, etc]
211+
210212
return {
211213
filtered: allowedPaths,
212214
};

0 commit comments

Comments
 (0)