Refactor setup.js
Refactor setup.js to break it up into smaller, more testable chunks.
If we export the functions themselves we can test those. Is there something more to do as well?
We could, but I think it might be more beneficial to extract them out into separate files. This way, any actual work/refactoring that needs to be done can be more focused and less concerned about side-effects. It'll also make the tests easier to write since there should be fewer dependencies that need to be mocked for each test suite.
If we export the individual functions aren't you only going to have to deal with that individual function when testing? I don't see the benefit of multiple files for code that isn't re-usable.
It's not just about reusability, it's also about readability, which smaller, focused, bite-sized files allow.
Either way though, if the path to least resistance is to export the individual functions and test it that way to get some sort of testing around setup.js then yes by all means we should do so, that sounds good! 😃
Hey! I'd love to help if needed.
Hi, can i contribute to this issue please ?