Skip to content

Latest commit

 

History

History
34 lines (18 loc) · 910 Bytes

Readme.md

File metadata and controls

34 lines (18 loc) · 910 Bytes

Golden Master Test with Nock example

About

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.

Requirements

  • 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.

Getting started

yarn install && yarn tsc

Entrypoint

yarn task --help

and follow the description.

Running as a golden master test case

yarn goldenMasterTest

Csv file

You will find the csv file at:

./out/data.csv