interlay / interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
Apache License 2.0
4 stars 7 forks source link

Add unit test runner with coverage #130

Closed bvotteler closed 1 year ago

bvotteler commented 1 year ago

After initially mostly only having stored data with very little transformations, we are starting to use Squid with more and more complex logic to track metrics, volumes, etc. It will be beneficial to be able to easily add unit tests.

Therefore, we want to add a test runner setup with code coverage to be run in github actions for pull requests. A good initial test case to add could be this one: #41

For code coverage, we need to exclude the generated code folders populated by squids scripts (via yarn command code:gen and gen:types:*).

Optional: Consider adding a coverage rule that needs to be passed that roughly resembles this: