Replacing MockClass with export classes and stubs #1125
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #1124
Context / Background
The MockClass class was create to replace the jest mocks as ES6 didn't allow mocking exported functions.
Turns out that sinon stub() could also be used if the export of a file was a whole class. It will replace the implementation used across all places where that class has been imported.
So we can easily replace the MockClass exports with creating a single normal class to hold the exports of a file.
What change is being introduced by this PR?
Modified files that used MockClass to have their own common export classes. Functions are all changed to be static functions of those classes.
Fixed import-export test to no longer leave leftover folders in the repo.
How will this be tested?
Same tests passing