You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to make Unit Testing inside Parse Server #4310
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.
Activity
acinader commentedon Oct 31, 2017
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:
https://github.com/parse-community/parse-server/blob/master/spec/CloudCode.spec.js#L79
flovilmart commentedon Oct 31, 2017
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.
acinader commentedon Oct 31, 2017
look at that! nice.
flovilmart commentedon Oct 31, 2017
We use it extensively for everything, that's very nice to test e2e cloud functions etc...
ZacharyKhan commentedon Dec 9, 2017
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.
flovilmart commentedon Dec 9, 2017
Open an issue on the test runner if you need an example :)