Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 950 Bytes

README.md

File metadata and controls

52 lines (34 loc) · 950 Bytes

Polly Test

Demo the features from Polly.js that let us record, replay, and stub HTTP interactions in our JavaScript applications.

This is a simple application that fetches an image of a dog 🐶 and shows its breed.

How to run the example

$ git clone https://github.com/d4vsanchez/pollyjs-example.git
$ cd pollyjs-example
$ yarn
$ yarn dev

And then go to http://localhost:3000

How to test

Record the initial request

Remove the provided HAR files created by Polly:

$ rm -r ./__tests__/__recordings__

Run the server (we need to do the real HTTP requests):

$ yarn dev

In another tab, execute the tests:

$ yarn test

It must re-create the __recurring__ folder.

Using the pre-made records

No need to run the server, make sure it's turned-off. Execute the tests:

$ yarn test

It must work correctly.