Remove hardhat and replace with vitest#27
Merged
jeffsmale90 merged 5 commits intomainfrom Jul 8, 2025
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on: |
Collaborator
Author
|
@SocketSecurity ignore npm/[email protected] |
5184882 to
e1e119b
Compare
hanzel98
reviewed
Jul 8, 2025
Contributor
hanzel98
left a comment
There was a problem hiding this comment.
Do we need this file with a reference to hardhat?
- standardise vitest dependency across monorepo. - update packages to 'type':'module' to fix vitest configuration resolution. - fix exports in @metamask/delegation-core to correctly target commonjs and esm.
e1e119b to
fb342c2
Compare
hanzel98
reviewed
Jul 8, 2025
packages/delegation-toolkit/test/caveatBuilder/createCaveatBuilder.test.ts
Show resolved
Hide resolved
hanzel98
reviewed
Jul 8, 2025
Comment on lines
+7
to
+14
| const factory = '0xfD9261637e09DD3c58643cDecC64A75EA235bBe8'; | ||
| const implementations = { | ||
| HybridDeleGatorImpl: '0x4Ec9f3fDaBCA7b4588f6C0bA94464De12Bbd2E22', | ||
| MultiSigDeleGatorImpl: '0xa8F73EC8374b6fF40712AF6C21D1e79e1a5186aa', | ||
| } as const; | ||
| const deploySalt = | ||
| '0x11a8b2a8c7cf03cd3ef899b0e934306bff980bdb10a1d9e84c7598253fee9bcf'; | ||
| const ownerAddress = '0x72ec0f88409247ebf9dc04a3521e5162d90cab1e'; |
Contributor
There was a problem hiding this comment.
I wonder if these hardcoded addresses could give us false positives in the future, meaning that they seem to work but maybe only for an old version
hanzel98
approved these changes
Jul 8, 2025
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.
📝 Description
Removes hardhat and related dependencies. Adds
vitestas test runner forpackages/delegation-toolkit.Previously
packages/delegation-toolkittests were run with hardhat.Coverage report is now shown when
yarn:testis executed.🚀 Why?
Test runners are inconsistent throughout the monorepo -
vitest,hardhat. Additionallyanvilandhardhat-networkare used in different packages for network simulation.Hardhatintroduces a complex dependency graph, including some critical dependencies. Removing this, and depending onvitestfor these unit tests brings consistency, and reduces dependency management.Additionally this simplifies our unit-testing, forcing us to isolate the component under test, while we can continue to do integration testing with our e2e test suite.
Resolves the following vulnerabilities:
🧪 How to Test?
This should bring no breaking changes, but improves the developer experience when running unit tests in
/packages/delegation-toolkit.Because this impacts how @metamask/delegation-core and @metamask/delegation-toolkit are bundled, it's important to test both esm and commonjs consumers for both packages.
I have validated this with commonjs with nodejs directly:
ensuring that each is correctly resolved.
I have validated with esm with the following:
List any breaking changes:
📋 Checklist
Check off completed items:
🔗 Related Issues
Link to related issues:
Closes #
Related to #
📚 Additional Notes
Any additional information, concerns, or context: