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

feat: create prefer-expect-resolves rule #822

Merged
merged 3 commits into from
Sep 29, 2021
Merged

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Apr 11, 2021

Resolves #803

I'd love to have a fixer, but jest kept giving me this:

(node:5300) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Node'
    |     property 'callee' -> object with constructor 'Node'
    --- property 'parent' closes the circle
    at stringify (<anonymous>)
    at writeChannelMessage (internal/child_process/serialization.js:117:20)
    at process.target._send (internal/child_process.js:805:17)
    at process.target.send (internal/child_process.js:703:19)
    at reportSuccess (/c/Users/G-Rath/workspace/projects-oss/eslint-plugin-jest/node_modules/jest-worker/build/workers/processChild.js:67:11)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5300) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5300) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

so will leave it as-is for now.

@SimenB
Copy link
Member

SimenB commented Jul 12, 2021

@G-Rath as a workaround to that bug, you can try to run in band (-i)

@G-Rath G-Rath force-pushed the create-prefer-expect-resolves branch from b34f133 to 543ce3f Compare July 15, 2021 20:56
@G-Rath
Copy link
Collaborator Author

G-Rath commented Jul 15, 2021

@SimenB created a fixer 🎉

@G-Rath G-Rath force-pushed the create-prefer-expect-resolves branch from 9a2560b to c1f47da Compare July 15, 2021 21:41
@SimenB
Copy link
Member

SimenB commented Sep 29, 2021

@G-Rath can you rebase? 🙂

@SimenB SimenB force-pushed the create-prefer-expect-resolves branch from c1f47da to 1a34267 Compare September 29, 2021 07:43
@SimenB SimenB merged commit 2556020 into main Sep 29, 2021
@SimenB SimenB deleted the create-prefer-expect-resolves branch September 29, 2021 07:46
github-actions bot pushed a commit that referenced this pull request Sep 29, 2021
# [24.5.0](v24.4.3...v24.5.0) (2021-09-29)

### Bug Fixes

* **no-deprecated-functions:** remove `process.cwd` from resolve paths ([#889](#889)) ([6940488](6940488))
* **no-identical-title:** always consider `.each` titles unique ([#910](#910)) ([a41a40e](a41a40e))

### Features

* create `prefer-expect-resolves` rule ([#822](#822)) ([2556020](2556020))
* create `prefer-to-be` rule ([#864](#864)) ([3a64aea](3a64aea))
* **require-top-level-describe:** support enforcing max num of describes ([#912](#912)) ([14a2d13](14a2d13))
* **valid-title:** allow custom matcher messages ([#913](#913)) ([ffc9392](ffc9392))
@github-actions
Copy link

🎉 This PR is included in version 24.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Sep 29, 2021
# [25.0.0-next.5](v25.0.0-next.4...v25.0.0-next.5) (2021-09-29)

### Bug Fixes

* **no-deprecated-functions:** remove `process.cwd` from resolve paths ([#889](#889)) ([6940488](6940488))
* **no-identical-title:** always consider `.each` titles unique ([#910](#910)) ([a41a40e](a41a40e))
* **valid-expect-in-promise:** support `finally` ([#914](#914)) ([9c89855](9c89855))
* **valid-expect-in-promise:** support additional test functions ([#915](#915)) ([4798005](4798005))

### Features

* create `prefer-expect-resolves` rule ([#822](#822)) ([2556020](2556020))
* create `prefer-to-be` rule ([#864](#864)) ([3a64aea](3a64aea))
* **require-top-level-describe:** support enforcing max num of describes ([#912](#912)) ([14a2d13](14a2d13))
* **valid-title:** allow custom matcher messages ([#913](#913)) ([ffc9392](ffc9392))
@github-actions
Copy link

🎉 This PR is included in version 25.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@fauxbytes
Copy link

Seems this test is flawed.
s/rejects/reject/
Plus, it fails?

@G-Rath
Copy link
Collaborator Author

G-Rath commented Oct 1, 2022

@fauxbytes thanks, I've opened #1253 fixing this.

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

Successfully merging this pull request may close these issues.

[new rule] prefer await expect(...).resolves
3 participants