Sitemap
Better Practices

For individual engineers to the largest teams, Better Practices is intended to distill knowledge from the Postman community. This is a place to learn about modern software practices together! Read more: https://medium.com/better-practices/introducing-better-practices-e9cf14cf0c88

Follow publication

Snapshot testing for APIs using Postman

6 min readFeb 13, 2019

--

Writing good tests with acceptable code coverage takes time, effort, practice, and patience

What is Snapshot Testing?

const add = (a, b) => a + bit('adds numbers', () => {
expect(add(2, 3)).toBe(5)
})
it('returns top seller item', () =>
api.get().then(item =>
expect(item).toMatchSnapshot()
)
)

Snapshot testing strategies

Snapshot Testing in Postman

Setting up snapshot testing collection
Save response as an example
Create a mock server
Snapshot testing workflow using Postman
Import snapshot testing collection from Postman Templates

--

--

Better Practices
Better Practices

Published in Better Practices

For individual engineers to the largest teams, Better Practices is intended to distill knowledge from the Postman community. This is a place to learn about modern software practices together! Read more: https://medium.com/better-practices/introducing-better-practices-e9cf14cf0c88

Prashant Agrawal
Prashant Agrawal

Written by Prashant Agrawal

Product & Engineering Manager @ Postman

Responses (6)