UNPKG

@apideck/portman

Version:

Port OpenAPI Spec to Postman Collection, with contract & variation tests included

19 lines 956 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.testResponseHeader = void 0; var application_1 = require("../../application"); var testResponseHeader = function (headerName, pmOperation, _aOperation, config) { var _a; var split = (_a = config === null || config === void 0 ? void 0 : config.separatorSymbol) !== null && _a !== void 0 ? _a : '::'; var pmTest = [ "// Validate if response header is present \n", "pm.test(\"[".concat(pmOperation.method.toUpperCase(), "]").concat(split).concat(pmOperation.path), " - Response header ".concat(headerName, " is present\", function () {\n"), " pm.response.to.have.header(\"".concat(headerName, "\");\n"), "});\n" ].join(''); (0, application_1.writeOperationTestScript)(pmOperation, pmTest); return pmOperation; }; exports.testResponseHeader = testResponseHeader; //# sourceMappingURL=testResponseHeader.js.map