New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qontract

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qontract

Node wrapper for qontract

  • 0.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Qontract is a contract driven development tool that allows us to turn our contracts into executable specification.

Installation

npm install qontract will install the qontract locally to the node project.

Sample npm scripts to run qontract:

"qontract-stub": "./node_modules/.bin/qontract-stub --contract-dir=*.qontract --stub-dir='path-to-stub-dir' --host='localhost' --port='8000'"

"qontract-test": "./node_modules/.bin/qontract-test --qontract-dir=*.qontract --host='localhost' --port='8000'"

Qontract in stub mode (For consumers)

In stub mode, Qontract provides random responses to requests that match the contract. It’s a way of exploring what the contract looks like. This is meant to be used by anyone who wants to take a fake version of the API for a spin. This mode can also stub out real requests and responses, which will be validated against the contract before being accepted.

Qontract tests (For Providers)

In test mode, Qontracts accepts a contract file, and the hostname and port of the service whose API is being tested. It then sends an HTTP request based on the request format described in the contract for every scenario, generating random values where no examples are given. When the service responds, it validates the response based on the format in the contract. This is meant to be used by API providers.

API

cli commands

qontract-stub run the qontract server in stub mode, used by consumers.

qontract-test run the qontract server in test mode, used by providers.

cli arguments

qontract-dir path of the contract files. Can be a wild card string.

stub-dir path of the mock json files.

host hostname

port port number

Check Documentation for more information.

Keywords

FAQs

Package last updated on 21 Aug 2020

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