UNPKG

swagger-tests

Version:

A typescript framework for testing an api against a swagger 3.0 json file.

32 lines 993 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const services_1 = require("../services"); const underscore_1 = require("underscore"); class AfterSupport { constructor(apiSupport) { this.apiSupport = apiSupport; } async success(response) { await this.addAuthorization(); if (underscore_1.contains(['delete', 'create'], this.apiSupport.operation.restAction)) { return true; } else { return services_1.HttpService.delete(this.apiSupport.axiosConfig, this.apiSupport.route, {}, response.data.id); } } async bad(_response) { return true; } async notFound(_response) { return this.apiSupport.operation.restMethod; } async unauthorized(_response) { return this.apiSupport.operation.restMethod; } async addAuthorization() { return true; } } exports.AfterSupport = AfterSupport; //# sourceMappingURL=after.support.js.map