codeceptjs 4.0.1-beta.5 → 4.0.1-beta.6

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.
@@ -45,6 +45,8 @@ class GraphQL extends Helper {
45
45
  timeout: 10000,
46
46
  defaultHeaders: {},
47
47
  endpoint: '',
48
+ onRequest: null,
49
+ onResponse: null,
48
50
  }
49
51
  this.options = Object.assign(this.options, config)
50
52
  this.headers = { ...this.options.defaultHeaders }
@@ -416,6 +416,7 @@ class Playwright extends Helper {
416
416
  ignoreHTTPSErrors: false, // Adding it here o that context can be set up to ignore the SSL errors,
417
417
  highlightElement: false,
418
418
  storageState: undefined,
419
+ onResponse: null,
419
420
  }
420
421
 
421
422
  process.env.testIdAttribute = 'data-testid'
@@ -94,7 +94,9 @@ const config = {}
94
94
  class REST extends Helper {
95
95
  constructor(config) {
96
96
  super(config)
97
- this.options = {
97
+
98
+ // Set defaults first
99
+ const defaults = {
98
100
  timeout: 10000,
99
101
  defaultHeaders: {},
100
102
  endpoint: '',
@@ -103,15 +105,16 @@ class REST extends Helper {
103
105
  onResponse: null,
104
106
  }
105
107
 
108
+ // Merge config with defaults
109
+ this._setConfig(config)
110
+ this.options = { ...defaults, ...this.options }
111
+
106
112
  if (this.options.maxContentLength) {
107
113
  const maxContentLength = this.options.maxUploadFileSize * 1024 * 1024
108
114
  this.options.maxContentLength = maxContentLength
109
115
  this.options.maxBodyLength = maxContentLength
110
116
  }
111
117
 
112
- // override defaults with config
113
- this._setConfig(config)
114
-
115
118
  this.headers = { ...this.options.defaultHeaders }
116
119
 
117
120
  // Create an agent with SSL certificate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.1-beta.5",
3
+ "version": "4.0.1-beta.6",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [