UNPKG

umbraco-cypress-testhelpers

Version:

Test helpers for making Cypress tests for Umbraco solutions

22 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResponseHelper = void 0; class ResponseHelper { /** * This strips the first 6 characters of the response body * as it assumes it will **always** contain the junk json data `)]}',\n` * * It would be better to use jsonHelper.getBody() * as it checks for its presence of the data * * @param response The raw HTTP response from the server * @returns The JSON data in the body of the response as an object * @deprecated Please use jsonHelper.getBody instead * @see jsonHelper.getBody() */ static getResponseBody(response) { return JSON.parse(response.body.substr(6)); } } exports.ResponseHelper = ResponseHelper; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzcG9uc2VIZWxwZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaGVscGVycy9yZXNwb25zZUhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxNQUFhLGNBQWM7SUFDekI7Ozs7Ozs7Ozs7O09BV0c7SUFDSCxNQUFNLENBQUMsZUFBZSxDQUFDLFFBQVE7UUFDN0IsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDN0MsQ0FBQztDQUNGO0FBaEJELHdDQWdCQyJ9