I'm in the process of creating a unit test and I'm trying to optimize it by creating a helper file to replace some repeated code. In doing so some of my expects will end up in this helper file, as it is written now. I'm using the Mocha testing framework and the Chai assertion library.
My questions are:
- Is it ok for these expects to be in the helper file?
- Is it best practice to keep all expects located within the test file?