As a developer, I would like the unit test to be well structured so that I will easily be able to contribute and add more unit tests and/or modify existing one while working on codex.
Context
The current Jest unit test do not have a common structure and can be hard to contribute too. An example can be the lookup tests. This file is very well tested, but all tests are set in one big group. A developer would need to read all the tests to make sure he can add a new one without duplication.
Change proposes
A suggested change would be to separate the tests into different groups. This can easily be done using nested describes. Furthermore this will allow the test itself to also be simplified as it will allow setup tests to be added into its own group.
- Break up tests into groups
- Update the Documentation to explain how to write and breakup tests
- Simplify tests by moving reusable setup