Generate API coverage between your Swagger definition and Postman collection
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 }