Add Client tests in @cubicweb/client
How to make sure the client is in sync with the API? There are several possibilities:
- write simple tests with network calls mocked with Jest
- Pros: Easy to setup, fast
- Cons: No way to ensure the mocks respect the API definition
- generate a mock server using a tool like Prism and run the tests against it
- Pros: Can ensure the client is in sync with the OpenApi spec, gives additional motivation to create a comprehensive spec
- Cons: Never tried it, needs an additional process to run alongside the tests
Following cubicwebjs!93 (merged), we now have a demo instance we can use to run tests against.