Unit testing
Unit testing can be done by following the strawberryβs testing docs reference.
This lib also provides a TestClient
and an AsyncTestClient
that makes it easier
to run tests by mimicing a call to your API.
For example, suppose you have a me
query which returns the currently logged in
user or None
in case it is not authenticated. You could test it like this:
For more information how to apply these tests, take a look at the source and this example