system-testing 1.0.13 → 1.0.14

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.
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ time: "01:00"
8
+ timezone: Europe/Berlin
9
+ open-pull-requests-limit: 99
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "system-testing",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "System testing with Selenium and browsers.",
5
5
  "keywords": [
6
6
  "system",
@@ -98,20 +98,32 @@ export default class SystemTestBrowserHelper {
98
98
  return this.originalConsoleLog(...args)
99
99
  }
100
100
 
101
- consoleLogMessage(arg) {
101
+ consoleLogMessage(arg, scannedObjects = []) {
102
102
  if (Array.isArray(arg)) {
103
+ if (scannedObjects.includes(arg)) {
104
+ return "[recursive]"
105
+ } else {
106
+ scannedObjects.push(arg)
107
+ }
108
+
103
109
  const result = []
104
110
 
105
111
  for (const value of arg) {
106
- result.push(this.consoleLogMessage(value))
112
+ result.push(this.consoleLogMessage(value, scannedObjects))
107
113
  }
108
114
 
109
115
  return result
110
116
  } else if (Object.prototype.toString.call(arg) === '[object Object]') {
117
+ if (scannedObjects.includes(arg)) {
118
+ return "[recursive]"
119
+ } else {
120
+ scannedObjects.push(arg)
121
+ }
122
+
111
123
  const result = {}
112
124
 
113
125
  for (const key in arg) {
114
- result[key] = this.consoleLogMessage(arg[key])
126
+ result[key] = this.consoleLogMessage(arg[key], scannedObjects)
115
127
  }
116
128
 
117
129
  return result