Files
cats-client.ts
What you'll learn
- Narrow a client response on res.status so json() is typed as the body of that status
- Wrap hc in a module that takes the base URL and ClientRequestOptions, so a test can inject fetch
- Turn an API's refusal into a return value or an error that carries the status and the message
Press Run tests to start the app. Its log appears here.Tests
- cats-client.spec.tsrun to see its tests