Code example for my hhjs talk about generating Golden Master Test with the help of nock.
The example uses the json-placeholder-api, it fetches each post and creates a csv file containing the id and tile. The example is a bit contrived and simplistic to focus on the golden master test setup.
- node8
- yarn
The project is written in typescript. The generated js files will be in the ./dist
folder, and the src
folder contains the actual project.
yarn install && yarn tsc
yarn task --help
and follow the description.
yarn goldenMasterTest
You will find the csv file at:
./out/data.csv