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.
Overview
This PR fixes #25. I had to made this patch to use this feature in my project. I expected that all the test tools are ready for typescript though.
Testing
Anyway, for testing, I copied the test file
mocking.getter.spec.ts
and replaced mock targets with each of abstract class and generic class. All passed. But I didn't try using this actually in my project yet.Implementation
I added a small feature that allows the parameter of abstract and generic classes on
mock()
Open Issues
There's an open issue: we can't accept interfaces and generic classes with type parameters. For interfaces, I'm not sure but typescript says that "Oh man, you can't use type as a value! Stop hacking me :p" And for generic classes, we need a feature on typescript where generic of generic is available, which is still on discussion.
Closing
Please review this PR kindly, and merge it if any issue isn't found.