Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 746 Bytes

README.md

File metadata and controls

15 lines (10 loc) · 746 Bytes

Jest Example

  1. In the pact-js project root, change to the examples/jest directory
  2. Run: npm i
  3. Run the tests: npm t

Comments about Jest

To avoid race conditions if you have multiple pact specs, we recommend running Jest 'in band'. If you are running a large unit test suite you may want to run that separately as a result to take advantage of the concurrency of jest (although this is not always faster). To achieve this you can get your pact tests to have a suffix of '.pact.js' and add the following Jest argument to your pact task in npm:

--testRegex \"/*(.test.pact.js)\""

This example uses jest-pact