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
{{ message }}
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
We have tests that use a wrapper with a ethers/hardhat provider and a mock connector. The connector uses sinon js for mocking. There are tests for about 9 contexts and EthersAppContext.
Overall Strategy
We want tests for all hooks.
We want to test the functions and helpers
useEthersContext needs tests for context key
We want to test hooks with update options.
I think choosing two hooks, useTokenBalance and useContractReader, and testing update options with that would be sufficient for tests that integrate hardhat and wrapper and the update options are being respected.
For other tests, we should mock useQuery or useEthersUpdater and make sure it is just getting the update options specified.
We should test override per hook
Hook test strategy
Tests for the functionality of the hook
Test update options: mock useQuery and useEthersUpdater to make sure it is receiving the right values
3 as BlockNumberInterval
polling
If the hook has an override: We should have two test per-hook that has the override option:
(1) mock useEthersContext and check if it receives the key properly
(2) make sure the hook works with the override adaptor.
If hooks are useTokenBalance or useContractReader we should have full functionality of updates in addition to mocking as mentioned in the overall strategy. Test update options with that would be sufficient for tests that integrate hardhat and wrapper and the update options are being respected.
Current status
We have tests that use a wrapper with a ethers/hardhat provider and a mock connector. The connector uses sinon js for mocking. There are tests for about 9 contexts and EthersAppContext.
Overall Strategy
useTokenBalance
anduseContractReader
, and testing update options with that would be sufficient for tests that integrate hardhat and wrapper and the update options are being respected.useQuery
oruseEthersUpdater
and make sure it is just getting the update options specified.Hook test strategy
useQuery
anduseEthersUpdater
to make sure it is receiving the right valuesuseTokenBalance
oruseContractReader
we should have full functionality of updates in addition to mocking as mentioned in the overall strategy. Test update options with that would be sufficient for tests that integrate hardhat and wrapper and the update options are being respected.Code standards
useTokenBalance
is a great example!Test issues
Add tests for Contexts
Add hook tests
Function tests
The text was updated successfully, but these errors were encountered: