@cuppet/core 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuppet/core",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Core testing framework components for Cuppet - BDD framework based on Cucumber and Puppeteer",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -109,7 +109,8 @@ module.exports = {
109
109
  });
110
110
  return this.response;
111
111
  } catch (error) {
112
- throw new Error(`Request failed with: ${error}. Response: ${JSON.stringify(this.response)}`);
112
+ console.log('Request has failed, use response code step definition to validate the response!');
113
+ return (this.response = error.response);
113
114
  }
114
115
  },
115
116
 
@@ -154,7 +155,9 @@ module.exports = {
154
155
  */
155
156
  validateResponseCode: async function (code) {
156
157
  if (this.response.status !== Number(code)) {
157
- throw new Error(`Response code is different than expected, code: ${this.response.status}`);
158
+ throw new Error(
159
+ `Response code is different than expected, code: ${this.response.status}. Response: ${this.response.data}`
160
+ );
158
161
  }
159
162
  },
160
163