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

Test collection helpers and stub them while testing other things #80

Open
gduquesnay opened this issue Jun 13, 2017 · 2 comments
Open

Comments

@gduquesnay
Copy link

Could anyone share an example of how you are testing meteor apps that are using collection helpers. I'd like to be able to unit test some of our collection helpers and then stub those helpers when testing methods that use them.

@dburles
Copy link
Owner

dburles commented Jun 13, 2017

@gduquesnay I've never done anything too fancy, did you have a particular case where you need to stub an individual helper?

@gduquesnay
Copy link
Author

Well .... our test is working right now but while writing this test I was thinking refactoring the function we are testing to move some stuff into a collection helper which we would then stub would make it easier to test.

In this case not knowing how to stub the collection helper requires us to set up much more fake data to get the test to pass.

Perhaps there's a way to save the existing helper, redefine it and then restore it after the test?

Thoughts?

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

No branches or pull requests

2 participants