Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mocking #31

Merged
merged 1 commit into from
Aug 10, 2017
Merged

Type mocking #31

merged 1 commit into from
Aug 10, 2017

Conversation

dyong0
Copy link

@dyong0 dyong0 commented Aug 10, 2017

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.

Chrome 60.0.3112 (Windows 10 0.0.0): Executed 140 of 140 SUCCESS (31.007 secs / 10.527 secs)

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.

@NagRock NagRock changed the base branch from master to issue/25 August 10, 2017 18:23
@NagRock NagRock merged commit c128f3d into NagRock:issue/25 Aug 10, 2017
@NagRock
Copy link
Owner

NagRock commented Aug 10, 2017

Hey! @dyong0 very big thanks for this PR. Looks great! I've made some readme changes and added one spec but it looks awesome. Thanks again. Merging and publishing to npm.

NagRock added a commit that referenced this pull request Aug 10, 2017
* added type mocking (#31)

* issue 25 - added spec for generic type mocking

* issue 25 - readme file updated with abstract class mocking information

* issue 25 - version bumped to 2.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants