ui5-test-runner 5.3.0 → 5.3.1

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.
@@ -74,6 +74,8 @@
74
74
 
75
75
  window['ui5-test-runner/stringify'] = stringify
76
76
 
77
+ const xPageUrl = top.location.toString()
78
+
77
79
  window[MODULE] = function post (url, data) {
78
80
  function request () {
79
81
  return new Promise(function (resolve, reject) {
@@ -85,18 +87,20 @@
85
87
  reject(xhr.statusText)
86
88
  })
87
89
  xhr.open('POST', base + '/_/' + url)
88
- xhr.setRequestHeader('x-page-url', top.location)
90
+ xhr.setRequestHeader('x-page-url', xPageUrl)
89
91
  xhr.setRequestHeader('content-type', 'application/json')
90
92
  const json = stringify(data)
91
93
  xhr.setRequestHeader('content-length', json.length)
92
94
  xhr.send(json)
93
95
  })
94
96
  }
95
- lastPost = lastPost
96
- .then(request)
97
- .then(undefined, function (reason) {
98
- console.error('Failed to POST to ' + url + '\nreason: ' + reason.toString())
99
- })
97
+ lastPost = lastPost.then(request)
98
+ if (!window.__unsafe__) {
99
+ lastPost = lastPost
100
+ .then(undefined, function (reason) {
101
+ console.error('Failed to POST to ' + url + '\nreason: ' + reason.toString())
102
+ })
103
+ }
100
104
  return lastPost
101
105
  }
102
106
  }())
@@ -45,9 +45,10 @@
45
45
  })
46
46
 
47
47
  function notify () {
48
- const modules = QUnit.config.modules.map(({ moduleId }) => moduleId)
48
+ const moduleIds = QUnit.config.modules.map(({ moduleId }) => moduleId).filter(moduleId => !!moduleId)
49
+ const moduleNames = QUnit.config.modules.map(({ name }) => name)
49
50
  const opa = !!window?.sap?.ui?.test?.Opa5
50
- post('addTestPages', { type: 'qunit', opa, modules, page: location.toString() })
51
+ post('addTestPages', { type: 'qunit', opa, module: { ids: moduleIds.length ? moduleIds : undefined, names: moduleNames }, page: location.toString() })
51
52
  }
52
53
  }
53
54
  }