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

Feature: Making ionic-mocks compatible with Jest by utilizing a local version of jasmines createSpyObject() #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MagicAardvark
Copy link

No description provided.

@stonelasley
Copy link
Owner

@MagicAardvark Thank you for the PR. As I stated previously I've never used jest so I'm coming at this from ignorance. How does this fix the problem in Jest? I'm comparing your createSpyObj function with jasmines and it looks like it's doing nearly the same thing it just has some checks removed.

https://github.com/jasmine/jasmine/blob/8ad9abb19a7fe4e686a86b7896cd20c554a4830a/src/core/base.js#L194

@MagicAardvark
Copy link
Author

Thanks for checking it out. So this fixes it for jest because jest does not expose jasmines createSpyObject method. so this PR is create a version of jasmines method that can be provided to jest.

Looks like they have updated the createSpyObject method so theoretically it should work with this new one. I can test today and update my PR to have the additional checks.

@stonelasley
Copy link
Owner

@MagicAardvark, thanks again. I'll merge this in as soon as I have time to test it against a couple projects I have. I also need to get caught up on tests. Feel free to throw in a couple test files ;)

@MagicAardvark
Copy link
Author

Did you have an opportunity to review this?

@danielsogl
Copy link

I published the Jest version here: https://www.npmjs.com/package/ionic-mocks-jest

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.

3 participants