How do I measure test coverage for an Anchor program?
- If I write my tests in typescript, then there are no code coverage reports
- If I write my tests in Rust (similar as specified here), and use the command
cargo llvm-cov nextest --html --output-dir ./coverage
then the coverage report does not include any code that was executed within the Solana test network/client/VM (not sure what's the correct term here). - I could try splitting out all functionality from each method on the Solana program into independent functions and test them in isolation, without running them through the test validator, but then I have no way of testing and seeing the coverage on the Anchor account definitions.