Description
Add snapshot testing to the `tdd-from-schema` skill so that generated integration tests include response schema snapshots. This catches unintentional response format changes (added/removed fields) that wouldn't fail a status code assertion.
Why
Schema changes in API responses are breaking changes for consumers. Snapshot tests catch these changes automatically and force explicit acknowledgment when the response shape intentionally changes. This complements the existing contract tests.
Acceptance Criteria
Example
```typescript
it('GET /users/:id response matches schema snapshot', async () => {
const res = await app.request('/v1/users/1');
const body = await res.json();
expect(Object.keys(body.data).sort()).toMatchInlineSnapshot(`
[
"createdAt",
"email",
"id",
"name",
"updatedAt",
]
`);
});
```
Description
Add snapshot testing to the `tdd-from-schema` skill so that generated integration tests include response schema snapshots. This catches unintentional response format changes (added/removed fields) that wouldn't fail a status code assertion.
Why
Schema changes in API responses are breaking changes for consumers. Snapshot tests catch these changes automatically and force explicit acknowledgment when the response shape intentionally changes. This complements the existing contract tests.
Acceptance Criteria
Example
```typescript
it('GET /users/:id response matches schema snapshot', async () => {
const res = await app.request('/v1/users/1');
const body = await res.json();
expect(Object.keys(body.data).sort()).toMatchInlineSnapshot(`
[
"createdAt",
"email",
"id",
"name",
"updatedAt",
]
`);
});
```