Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(expect-expect): change suggested rule config #825

Merged
merged 1 commit into from Apr 14, 2021

Conversation

callumgare
Copy link
Contributor

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(). Without this change the following would raise an error/warning:

describe('Get All Items', () => {
  it('/items/all returns json list of all items', () =>
    request(app)
      .get('/items/all')
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200),
  )
})

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()`).
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@SimenB SimenB merged commit 004a9cb into jest-community:main Apr 14, 2021
@github-actions
Copy link

🎉 This PR is included in version 24.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants