-
Notifications
You must be signed in to change notification settings - Fork 20
Testing elm web3
-
Traditional, fast, and fully automated unit testing will likely not be possible. Nearly everything is Elm tasks, and is interacting with a very asynchronous platform. The need for transactional currency complicates things as well (gas on
sendTransaction
calls). Also, the need to work with MetaMask further adds to the complexity. -
Imagining a big html table where each row is a certain web3 function (unit test), and columns are
Function Name, Pass/Fail (green/red text and small description)
. Accordion/expandable rows for test Description, parameter info, and descriptive error responses. Tooltips could be useful as well. -
Will likely need separate tests for each network.
- Mainnet will focus on reads with known responses. (e.g. Some popular ERC20 contract's Transfer events, known balance of account at certain block, etc.)
- Ropsten tests will actually deploy contracts, engage in sendTransactions, etc.
- TestRPC, similar to Ropsten, but faster with optional usage if MetaMask (since testrpc accounts are prefilled and unlocked)
-
One HTML file per test suite, or break things up?
-
Use a mixture of Task.sequence and Task.andThen chaining