-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
How to make Unit Testing inside Parse Server #4310
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
Comments
My suggestion is to take a look at how unit testing is done on the parse-server repo itself. https://github.com/parse-community/parse-server/blob/master/package.json#L75 is the command that runs the tests. Which looks complicated, but basically its just invoking jasmine. The jasmine config: https://github.com/parse-community/parse-server/blob/master/spec/support/jasmine.json The helper.js that sets up and tears down the database and the parse-server: https://github.com/parse-community/parse-server/blob/master/spec/helper.js the helper has a lot of legacy code in it. And finally, here's an example of a test of cloud code: |
There is also this test runner that we wrote: https://github.com/AmpMe/parse-server-test-runner It will connect to a local database and you can cleanup data at will. |
look at that! nice. |
We use it extensively for everything, that's very nice to test e2e cloud functions etc... |
Thank you for you answer, I'll take a look at this |
Just came across this, very interesting! How would I implement something like the Parse-Server-test-runner? If I’m able to grasp it and get it working, I’d love to contribute to the README or WIKI with instructions for others to use this. I think it’s super useful! EDIT: I see there’s an example in the Repo for the test runner. I’m not familiar with the language as I write in Swift mostly, but I will play with this and see how far I can get using the example provided. |
Open an issue on the test runner if you need an example :) |
How we can make unit testing with Parse, in each Cloud Code Function I have multiples query it is difficult to test actually,
How we can make unit test with Parse Query ?
The text was updated successfully, but these errors were encountered: