Dredd is a language-agnostic command-line tool that performs contract testing by comparing backend API responses with an OpenAPI/Swagger or API Blueprint definition file.
How to initialize and run Dredd CLI for contract testing?
Dredd makes contract testing straightforward directly from command prompt.
1. Install Dredd
npm install -g dredd2. Initialize Configuration
dredd initThis command interactively generates a dredd.yml configuration file specifying API description files, backend server URLs, and hook scripts.
3. Run Contract Tests
dredd openapi.yaml http://127.0.0.1:3000Dredd sends requests to the live backend server and validates status codes, response headers, and body schemas against the OpenAPI specification.