@jahia/cypress 5.0.0 → 5.1.0
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.
|
@@ -91,13 +91,18 @@ var runProvisioningScript = function (_a) {
|
|
|
91
91
|
}, body: formData, log: false }, requestOptions);
|
|
92
92
|
cy.request(request).then(function (res) {
|
|
93
93
|
response = res;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
// If the response status is 200, decode the response, otherwise return the response as is
|
|
95
|
+
if (res.status === 200) {
|
|
96
|
+
try {
|
|
97
|
+
var decoder = new TextDecoder();
|
|
98
|
+
result = JSON.parse(decoder.decode(response.body));
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
result = e;
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
|
-
|
|
100
|
-
result =
|
|
104
|
+
else {
|
|
105
|
+
result = res;
|
|
101
106
|
}
|
|
102
107
|
logger === null || logger === void 0 ? void 0 : logger.end();
|
|
103
108
|
return result;
|
package/package.json
CHANGED
|
@@ -138,12 +138,17 @@ export const runProvisioningScript = ({
|
|
|
138
138
|
|
|
139
139
|
cy.request(request).then(res => {
|
|
140
140
|
response = res;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
|
|
142
|
+
// If the response status is 200, decode the response, otherwise return the response as is
|
|
143
|
+
if (res.status === 200) {
|
|
144
|
+
try {
|
|
145
|
+
const decoder = new TextDecoder();
|
|
146
|
+
result = JSON.parse(decoder.decode(response.body));
|
|
147
|
+
} catch (e) {
|
|
148
|
+
result = e;
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
result = res;
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
logger?.end();
|