brianvoe / slim-select

Slim advanced select dropdown
http://slimselectjs.com
MIT License
1.03k stars 195 forks source link

Unit tests #535

Closed Data5tream closed 5 months ago

Data5tream commented 5 months ago

This PR adds unit tests for a lot of code.

It also adds two GitHub Actions: one for jest that simply run the tests on pushes that change code and one for code coverage that runs on PRs.

The code coverage currently sits at 77% of statements (and LOCs) and I've set the threshold for the coverage check at 75% (maybe that's to high?).

brianvoe commented 5 months ago

Just let me know when your done and ill get it merged in

Data5tream commented 5 months ago

The code coverage action keeps failing because it doesn't have write access to the PR, but I can't figure out a way of doing the coverage report otherwise. Do you have an idea how this can be improved?

Otherwise I would consider the PR done. Improvements to the tests are something I'll look into in the future, there's still a lot to do.

brianvoe commented 5 months ago

I personally dont care about code coverage in this instance so if its just easier to have it run tests for now I would be ok with that.

Data5tream commented 5 months ago

Removed the action for now. Let's merge it 😄