Remove ESLint jest/valid-expect-in-promise#426
Merged
Conversation
Gudahtt
requested changes
Mar 23, 2021
Member
Gudahtt
left a comment
There was a problem hiding this comment.
Mostly good! The Transaction controller tests need some adjustment
Gudahtt
previously approved these changes
Mar 25, 2021
Member
Gudahtt
left a comment
There was a problem hiding this comment.
LGTM!
Lots more examples left where an expect call is in an event handler that may or may not finish before the test ends, but we can fix that separately. I'll add another checklist item for that.
| controller.cancelTransaction(controller.state.transactions[0].id); | ||
| result.catch((error) => { | ||
| expect(error.message).toContain('User rejected the transaction'); | ||
| resolve(''); |
Member
There was a problem hiding this comment.
Nit: we don't need to pass anything to resolve here.
Suggested change
| resolve(''); | |
| resolve(); |
Member
There was a problem hiding this comment.
Bah. I committed this, but now the test fails because the type needs to be adjusted. I'm going to undo this for now - we can fix it some other time.
1382ec8 to
56c1c91
Compare
Gudahtt
approved these changes
Apr 7, 2021
Member
|
I decided to go ahead and merge this now, to reduce the chance of future conflicts |
Gudahtt
added a commit
that referenced
this pull request
Apr 15, 2021
- Add restricted controller messenger ([#378](#378)) - **BREAKING:** Update minimum Node.js version to v12 ([#441](#441)) - **BREAKING:** Replace controller context ([#387](#387)) - Bump @metamask/contract-metadata from 1.23.0 to 1.24.0 ([#440](#440)) - Update lint rules ([#442](#442), [#426](#426)) - Don't remove collectibles during auto detection ([#439](#439))
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
* refactor catch errors to async await format * finish promise callback removal * restore ordering * promise does not resolve * use listener to ensure expects are called Co-authored-by: Mark Stacey <markjstacey@gmail.com>
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
* refactor catch errors to async await format * finish promise callback removal * restore ordering * promise does not resolve * use listener to ensure expects are called Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Mrtenz
pushed a commit
that referenced
this pull request
Oct 16, 2025
…d core monorepo (#420)" (#423) (#426) This reverts commit d8129a6 (Reapplies d10c455) <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? Are there any issues or other links reviewers should consult to understand this pull request better? For instance: * Fixes #12345 * See: #67890 --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Overhauls the dev toolchain: upgrades ESLint to v9 with new configs/plugins, moves to TypeScript 5.x, adds TypeDoc/depcheck/ts-bridge/ATTW tooling, updates Prettier to v3, and refreshes dependencies. > > - **Dev toolchain sync/upgrade** > - **ESLint 9**: Bump core and configs (MetaMask v14), migrate plugins/resolvers (e.g., `eslint-plugin-import-x`, `eslint-import-resolver-typescript`), and update related utilities. > - **TypeScript 5.x**: Update TypeScript, `typescript-eslint` (v8), `ts-node`, and supporting packages. > - **Formatting & docs**: Upgrade **Prettier** to v3 and `prettier-plugin-packagejson`; add **TypeDoc**. > - **New tooling**: Add `@arethetypeswrong/cli`, `@ts-bridge/cli`, and **depcheck** for dependency hygiene. > - **Dependencies**: Broad dependency updates and lockfile refresh to align with core template. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5ef56a47b1975d8ded4b528f0e5bd76585e4bac1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the way the tests catch errors. Currently they are wrapped in promises, but instead it can be refactored to use a jest trick of await expect(function).rejects.toThrow('error message'). Using this trick, we can remove this lint rule.