Skip to content

Commit

Permalink
docs(expect-expect): change suggested rule config
Browse files Browse the repository at this point in the history
Change the suggested rule config for jest/expect-expect when using supertest to use
"request.**.expect" in the assertFunctionNames array rather than "request.*.expect". A supertest
chained assertion may have more than one function call between `request(app)` and `.expect()`
(such as `.set()`).
  • Loading branch information
callumgare committed Apr 14, 2021
1 parent fb5eb5e commit 0e43630
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rules/expect-expect.md
Expand Up @@ -87,10 +87,10 @@ it('is money-like', () => {

Examples of **correct** code for working with the HTTP assertions library
[SuperTest](https://www.npmjs.com/package/supertest) with the
`{ "assertFunctionNames": ["expect", "request.*.expect"] }` option:
`{ "assertFunctionNames": ["expect", "request.**.expect"] }` option:

```js
/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "request.*.expect"] }] */
/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "request.**.expect"] }] */
const request = require('supertest');
const express = require('express');

Expand Down

0 comments on commit 0e43630

Please sign in to comment.