End-to-end testing
Summary
In addition to unit tests for each of the various modules, the
@ethdebug/pointers reference implementation includes automated integration
tests that watch the changes to a dereference()
d pointer over the course of
the execution of some Solidity code, ensuring that all expected values appear in
their expected sequence.
These tests are defined to use a developer-friendly programmatic EVM and Ethereum JSON-RPC simulator that models an Ethereum blockchain for purposes of transactions and state inspection.
Unmaintained dependencies warning
The testing implementation described in this section uses the unmaintained Ganache, thus resulting in @ethdebug/pointers having a developer dependency on this package. This dependency poses no concern for @ethdebug/pointers distributions, but may impact future developers who are looking to build/test this reference implementation locally.
At the time of implementation, Ganache was selected for use in these tests
because it was uniquely suitable for use programmatically inside TypeScript.
Sadly, other options such as Hardhat's npx hardhat node
and Foundry's Anvil
would have required additional setup in the form of operating system process
management and complex adapter setup.
Due to Ganache's end-of-life timing, these tests are limited in that they cannot test pointers to transient storage. Features from EVM versions before the Cancun hardfork should continue to work so long as there are no breaking changes introduced by Node.js.