Skip to content

unit testing for cloud code triggers (afterSave, beforeSave ... etc)? #1819

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

Closed
benishak opened this issue May 17, 2016 · 1 comment
Closed

Comments

@benishak
Copy link
Contributor

I want to test if my code in beforeSave works fine or not

In my beforeSave I can increment or update same fields of the same object or even of a different object, for example if user like a post in my app, I can increment the likeCount in the _User class.

Is there a way to test such kind of code?

@drew-gross
Copy link
Contributor

Now that Parse Server is open source, you can spin up a parse server in your tests and use it to do unit testing. Easy! For running mongodb in tests, check out mongodb-runner, which is what we use to test Parse Server itself.

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