-
Notifications
You must be signed in to change notification settings - Fork 8
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
Cloud code #3
Comments
HI @JulienKode. In our setup, we need to reference cloud main file with the full path:
Then it should be good |
Perfect, thank you 👍 @flovilmart |
We always run our tests with the full cloud code loaded for edge to edge tests. Then it you wanna test a particular JavaScript method, you don’t need parse server. The best test harnesses have a good balance between edge to edge an unit tests |
@flovilmart really great stuff here! Worked like a charm! Could I ask, where's the best place to set the beforeAll, afterAl, beforeEach hooks in order to re-use them across our testing suites, rather then copying it for each file? |
@omairvaiyani what you could do is leverage a global function in your helper.js given you’re using jasmine. Or you could put it in any module and simply export it where you need it.
Then in your tests, instead of calling Fill in the beforeEach/afterEach/beforeAll/afterAll with cleaningDb, starting / stopping the server etc... Does it make sense? Sent with GitHawk |
That's great thanks! I ended placing the hooks at the root-level suite, therefore the server will only start once across all the suites. I'll see if I run into side-effects, in which case your example would be helpful. |
Best way to test cloud code:
I'm wondering what is the best way to test cloud code functions.
It is better to launch the server with all cloud code or just test the function appropriately without cloud code plugged
The text was updated successfully, but these errors were encountered: