The collaboration server comes with a testing suite to test your resolvers.
The testing suite will perform a set of reads/write from your database using your resolvers, and inform you if any information is incorrect/missing.
The testing suite reads and writes testing data to/from your database. This may be a destructive operation.
⚠️ Please make sure to run the testing suite against an empty database. ⚠️
To use the test suite, create a node script that imports the testing suite and calls it against your resolvers.
The second parameter should be the getNow function that you also pass into the CollabServer constructor. This parameter is options, but recommended.
Then, execute the script
TestResolvers function will resolve with an array of error objects. If the array is empty, your resolvers are good to go!
Each error object contains the following information:
resolver(string) the name of the resolver with an error
queryParams(string) a JSON string containing the params that were passed into the resolver
error(object) information about the error
type(string) the type of error. One of
property(string) the name of the property that is invalid
expected(any) the data that was expected
received(any) the data that was received
message(string) an error message