@serenity-js/rest
Advanced tools
Comparing version 2.0.1-alpha.16 to 2.0.1-alpha.17
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.0.1-alpha.17](https://github.com/jan-molak/serenity-js/compare/v2.0.1-alpha.16...v2.0.1-alpha.17) (2019-02-13) | ||
### Bug Fixes | ||
* **rest:** Descriptions of HTTPRequests are more human-friendly, and so is the description of the Lo ([2368eba](https://github.com/jan-molak/serenity-js/commit/2368eba)) | ||
## [2.0.1-alpha.16](https://github.com/jan-molak/serenity-js/compare/v2.0.1-alpha.15...v2.0.1-alpha.16) (2019-02-13) | ||
@@ -8,0 +19,0 @@ |
@@ -45,2 +45,9 @@ import { AnswersQuestions, KnowableUnknown, Question, UsesAbilities } from '@serenity-js/core'; | ||
private httpMethodName; | ||
/** | ||
* @desc | ||
* A human-readable description of the request, such as "a GET request", "an OPTIONS request", etc. | ||
* | ||
* @private | ||
*/ | ||
private requestDescription; | ||
} |
"use strict"; | ||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } | ||
return cooked; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var io_1 = require("@serenity-js/core/lib/io"); | ||
/** | ||
@@ -56,3 +61,3 @@ * @desc | ||
HTTPRequest.prototype.toString = function () { | ||
return "a " + this.httpMethodName() + " request"; | ||
return this.requestDescription() + " to " + io_1.formatted(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), this.resourceUri); | ||
}; | ||
@@ -69,5 +74,16 @@ /** | ||
}; | ||
/** | ||
* @desc | ||
* A human-readable description of the request, such as "a GET request", "an OPTIONS request", etc. | ||
* | ||
* @private | ||
*/ | ||
HTTPRequest.prototype.requestDescription = function () { | ||
var vowels = ['A', 'E', 'I', 'O', 'U'], method = this.httpMethodName(); | ||
return (~vowels.indexOf(method[0]) ? 'an' : 'a') + " " + method + " request"; | ||
}; | ||
return HTTPRequest; | ||
}()); | ||
exports.HTTPRequest = HTTPRequest; | ||
var templateObject_1; | ||
//# sourceMappingURL=HTTPRequest.js.map |
{ | ||
"name": "@serenity-js/rest", | ||
"version": "2.0.1-alpha.16", | ||
"version": "2.0.1-alpha.17", | ||
"description": "Test REST APIs with Serenity/JS", | ||
@@ -50,6 +50,6 @@ "author": { | ||
"devDependencies": { | ||
"@documentation/esdoc-template": "2.0.1-alpha.16", | ||
"@integration/testing-tools": "2.0.1-alpha.16", | ||
"@serenity-js/assertions": "2.0.1-alpha.16", | ||
"@serenity-js/core": "2.0.1-alpha.16", | ||
"@documentation/esdoc-template": "2.0.1-alpha.17", | ||
"@integration/testing-tools": "2.0.1-alpha.17", | ||
"@serenity-js/assertions": "2.0.1-alpha.17", | ||
"@serenity-js/core": "2.0.1-alpha.17", | ||
"axios": "0.18.0", | ||
@@ -80,3 +80,3 @@ "axios-mock-adapter": "^1.16.0" | ||
}, | ||
"gitHead": "723badb09f1210a8d7b98d207c10184c017089e9" | ||
"gitHead": "71810ac6fd68746b8bc00c4e89a802edb86849d8" | ||
} |
import { AnswersQuestions, KnowableUnknown, Question, UsesAbilities } from '@serenity-js/core'; | ||
import { formatted } from '@serenity-js/core/lib/io'; | ||
import { AxiosRequestConfig } from 'axios'; | ||
@@ -64,3 +65,3 @@ | ||
toString() { | ||
return `a ${ this.httpMethodName() } request`; | ||
return `${ this.requestDescription() } to ${ formatted `${ this.resourceUri }` }`; | ||
} | ||
@@ -78,2 +79,16 @@ | ||
} | ||
/** | ||
* @desc | ||
* A human-readable description of the request, such as "a GET request", "an OPTIONS request", etc. | ||
* | ||
* @private | ||
*/ | ||
private requestDescription(): string { | ||
const | ||
vowels = [ 'A', 'E', 'I', 'O', 'U' ], | ||
method = this.httpMethodName(); | ||
return `${ ~vowels.indexOf(method[0]) ? 'an' : 'a' } ${ method } request`; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137545
2803