pact-gen-ts
Version:
Generating pact files from typescript definitions
17 lines (16 loc) • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PactAxiosResponseBody = void 0;
const type_representation_1 = require("../../core/type-representation");
const create_pact_example_object_1 = require("../../core/create-pact-example-object");
const create_pact_matching_rules_1 = require("../../core/create-pact-matching-rules");
const body_1 = require("../../core/body");
class PactAxiosResponseBody extends body_1.Body {
constructor(axios, sourceFile) {
super();
const basicTypeRepresentationOfResponse = (0, type_representation_1.getTypeRepresentation)(axios.getResponseBodyType(), sourceFile, true);
this.body = (0, create_pact_example_object_1.changeObjectRepresentationIntoExample)(basicTypeRepresentationOfResponse);
this.matchingRules = (0, create_pact_matching_rules_1.changeObjectRepresentationIntoMatchingRules)(basicTypeRepresentationOfResponse, '$.body');
}
}
exports.PactAxiosResponseBody = PactAxiosResponseBody;