philomena-dev / philomena

Next-generation imageboard
GNU Affero General Public License v3.0
84 stars 29 forks source link

Add JS utility unit tests with Jest #144

Closed SeinopSys closed 2 years ago

SeinopSys commented 2 years ago

Before you begin


The goal of this PR to achieve unit tests coverage in the utility JavaScript files of the application in preparation for migration to TypeScript. This is to ensure no existing functionality will be broken by this process.

Running tests has also been added to CI, however, coverage requirements are only enforced inside the assets/js/utils folder. Once coverage reaches a certain threshold it may be worth raising the global minimum percentage, but for now it should be kept at 0 to allow gradual introduction of unit tests.