Running tests
To run the test suite:- Builds the project (
yarn build) - Runs Jest tests against the compiled output in
./dist
Test configuration
The project uses Jest for testing. Configuration is defined inpackage.json:
Test structure
Tests are located alongside their source files with the.spec.ts extension:
Coverage collection
Jest is configured to collect coverage from all TypeScript files in thesrc directory, excluding:
abi/directory (contract ABIs)types/directory (generated types)
Testing considerations
Integration tests
When testing against blockchain interactions:- Tests run against the compiled JavaScript in
./dist - Ensure the project is built before running tests
- Consider mocking RPC calls for unit tests
Test isolation
The test configuration uses:automock: false- Manual mocking controlresetMocks: false- Mocks persist between tests unless explicitly reset