All jobs / Full-stack developer / Testing

Full-stack developer interview question · 0–1 years

You are writing your first tests for a POST endpoint. What do you actually assert?

The strongest answer

The status code, the shape and key fields of the response, that the record really changed in the database, and that bad input comes back as a validation error rather than a 500

Why it works

Exactly — status, body contract, persisted effect, and the unhappy path. Those four are what a consumer depends on.

What a good answer covers

Answers that fall short

Who gets asked this

More Testing questions