Skip to content

Generate API coverage between your Swagger definition and Postman collection

License

Notifications You must be signed in to change notification settings

abelmokadem/swagger-coverage-postman

Repository files navigation

swagger-coverage-postman

Travis Codecov version downloads license semantic-release

Generate API coverage between your Swagger definition and Postman collection

Usage

npm install --save swagger-coverage-postman
const coverage = require("swagger-coverage-postman");
const refParser = require("json-schema-ref-parser");

// Load swagger file
const apiFile = path.join(__dirname, "api.yaml");
const api = await refParser.dereference(apiFile);

// Load postman integration test file
const integrationTestsFile = path.join(__dirname, "integration-tests.json");
const integrationTests = require(integrationTestsFile);

// Calculate coverage summary
const coverageSummary = await coverage.summary(api, integrationTests);

console.log(coverageSummary);
// { paths: 1, methods: 0.86, parameters: 0.15 } 

About

Generate API coverage between your Swagger definition and Postman collection

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published