w3f / staking-rewards-collector

Apache License 2.0
78 stars 32 forks source link

chore: Add Jest testing lib; add utils/ tests #41

Open jrmykolyn opened 2 years ago

jrmykolyn commented 2 years ago

Overview:

This pull request introduces the following changes:

Rationale: Adding support for unit-level tests may increase the likelihood of additional contributions. It will also set a precedent in terms of what is expected for future contributions.

I have include a small number of tests for a small number of utility functions. If the pull request is accepted and merged then I'm happy to increase the test coverage. If not then only a small amount of time will be lost.

Why Jest?:

Jest is an widely-used and well-supported unit testing framework for JavaScript and TypeScript projects. The current number of monthly downloads via npm is > 15,000,000. This is significantly more than other popular unit testing frameworks, such as Mocha (~6,000,000), Jasmine (~2,000,000), and Ava (~200,000).

jrmykolyn commented 2 years ago

CC: @jonasW3F for review. 🙏

jonasW3F commented 2 years ago

Hi @jrmykolyn - Thanks! I will take a look as soon as I find the time

jrmykolyn commented 2 years ago

Hi @jrmykolyn - Thanks! I will take a look as soon as I find the time

Great, thanks a lot!

Also, if there's anything I can do to make this (or future) pull requests easier to review, please let me know. 👍