@cuppet/core 1.1.0 → 1.1.2

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.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Core testing framework components for Cuppet - BDD framework based on Cucumber and Puppeteer",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -12,8 +12,6 @@ module.exports = {
12
12
  response: null,
13
13
  /** @type {object} */
14
14
  request: null,
15
- /** @type {object} */
16
- formData: null,
17
15
 
18
16
  /**
19
17
  * Prepare path for API test usage
@@ -45,9 +43,9 @@ module.exports = {
45
43
  'Content-Type': 'application/json',
46
44
  Accept: 'application/json',
47
45
  };
48
- if (this.formData) {
46
+ if (this.request instanceof FormData) {
49
47
  defaultHeaders = {};
50
- Object.assign(defaultHeaders, this.formData.getHeaders());
48
+ Object.assign(defaultHeaders, this.request.getHeaders());
51
49
  }
52
50
  if (config.has('api.x-api-key')) {
53
51
  defaultHeaders['X-Api-Key'] = config.get('api.x-api-key');
@@ -106,9 +104,6 @@ module.exports = {
106
104
  if (this.request) {
107
105
  data = this.request;
108
106
  }
109
- if (this.formData) {
110
- data = this.formData;
111
- }
112
107
  try {
113
108
  this.response = await axios.request({
114
109
  url: apiUrl,
@@ -316,7 +311,7 @@ module.exports = {
316
311
  formData.append(key, await storage.checkForSavedVariable(value));
317
312
  }
318
313
  }
319
- this.formData = formData;
320
- return this.formData;
314
+ this.request = formData;
315
+ return this.request;
321
316
  },
322
317
  };