Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like this approach.

Is your expected.json the actual response body, or is it an object containing body, status, header values, and time-taken, etc?



It's only the response body, but that's due to not having a usecase to validate headers or status code.

I really like it because it serves 3 purposes:

- API docs/examples that you can interact with

- Test cases

- Manually invoking API endpoints when working on the underlying code, in an iterative loop




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: