You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since our move to Vitest in #1310, although the API is very close to Jest, there are differences in how Jest approaches mocking. One area is that we can no longer mock dependencies that are used by test setup files. Such as our dependency on ethers to hexlify a test worker ID to retrieve a private key, to access a faucet to be used in tests.
Error: [vitest] Cannot mock "ethers" because it is already loaded. Did you import it in a setup file?
Since we have introduced our own hexlify function in #1401, we can use this instead. However we will then need to remove the ethers dependency from the utils package. The main awkwardness for this is the BytesLike type that is used across the SDK. However we should look to introduce our own to across the board reduce our dependency on ethers.
We have also pinned our vitest version to counteract this error, so currently we risk being out of date.
The text was updated successfully, but these errors were encountered:
Since our move to Vitest in #1310, although the API is very close to Jest, there are differences in how Jest approaches mocking. One area is that we can no longer mock dependencies that are used by test setup files. Such as our dependency on
ethers
tohexlify
a test worker ID to retrieve a private key, to access a faucet to be used in tests.We now see the following error - source:
Since we have introduced our own
hexlify
function in #1401, we can use this instead. However we will then need to remove theethers
dependency from theutils
package. The main awkwardness for this is theBytesLike
type that is used across the SDK. However we should look to introduce our own to across the board reduce our dependency onethers
.We have also pinned our vitest version to counteract this error, so currently we risk being out of date.
The text was updated successfully, but these errors were encountered: