Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

api-tests-template

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-tests-template

This POC is created using a nodejs library called Pact.

  • 1.0.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

POC for Contract Testing (Pact)

This POC is created using a nodejs library called Pact.

https://github.com/pact-foundation/pact-js

Pact is a contract testing tool. Contract testing is a way to ensure that services (such as an API provider and a client) can communicate with each other. https://docs.pact.io/readme

How to use

Required packages and basic setup is done. There are useful comments included so code should be pretty straight forward.

You're all set to start writing tests :-)

To Run Tests

yarn install to install dependencies

yarn test:consumer to run consumer tests against mock server and generate pact file

yarn publish:pacts to start a docker http server and publish pacts to be accessible to provider

yarn test:provider to run the pact file against the actual server and publish results back to http server

yarn test:e2e to run the all the above steps in one go for end to end worklfow

Test Report

mochawesome reporter is used to capture and present the test results.

Test Report is available in ./mochawesome-report in both json and html format

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc