popcorn-official / popcorn-api

Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player. Compatible API Anime/Movies/Show Scrapper
https://popcorntime.app
MIT License
624 stars 100 forks source link

Implement Helper tests #93

Closed ChrisAlderson closed 6 years ago

ArthurSampaio commented 6 years ago

Hi @ChrisAlderson, can you be more specific about who entity need be tested?

ChrisAlderson commented 6 years ago

The MovieHelper and ShowHelper classes need to be further tested. They are difficult to test since those classes are pretty complex so maybe it's best to rewrite them first before implementing more test cases.

ArthurSampaio commented 6 years ago

Ok, i want do this. Do you have any tip for the refactor of this entities? and do you indicate any design pattern for unit test?

ChrisAlderson commented 6 years ago

You can refactor the complex parts into seperate methods to reduce the complexity. An ESLint rule you could add only for testing purposes would be the complexity rule.

As for the unittests: