@mablhq/mabl-cli 2.44.1 → 2.45.5
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/api/featureSet.js +1 -5
- package/api/mablApiClient.js +7 -5
- package/browserEngines/chromiumBrowserEngine.js +0 -4
- package/commands/tests/testsUtil.js +4 -0
- package/core/execution/ApiTestUtils.js +52 -24
- package/execution/index.js +2 -2
- package/mablApi/index.js +1 -1
- package/mablscript/actions/ConditionAction.js +4 -3
- package/mablscript/importer.js +9 -1
- package/mablscript/steps/AssertStep.js +23 -18
- package/mablscript/steps/IfConditionStep.js +13 -5
- package/package.json +1 -1
- package/providers/exportRequestProvider.js +5 -0
- package/upload/index.js +1 -1
- package/util/logUtils.js +18 -5
package/util/logUtils.js
CHANGED
|
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.promiseRejectionMiddlewareMetric = exports.getPromiseSettledValues = exports.logPromiseSettledRejections = exports.logErrorVerbose = exports.formatTimestamp = exports.valueToString = exports.logWebUIAndCliOutput = exports.logWebUI = exports.findResultSeverityToLogLevel = exports.logCliOutput = exports.logInternal = void 0;
|
|
6
|
+
exports.promiseRejectionMiddlewareMetric = exports.getPromiseSettledValues = exports.logPromiseSettledRejections = exports.logErrorVerbose = exports.formatTimestamp = exports.maybeTruncateLongMessage = exports.valueToString = exports.logWebUIAndCliOutput = exports.logWebUI = exports.findResultSeverityToLogLevel = exports.logCliOutput = exports.logInternal = exports.TRUNCATED_MESSAGE_SUFFIX = exports.VALUE_TO_STRING_DEFAULT_LIMIT = void 0;
|
|
7
7
|
const mablscriptFind_1 = require("../mablscriptFind");
|
|
8
8
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
9
9
|
const moment_1 = __importDefault(require("moment"));
|
|
10
10
|
const constants_1 = require("../commands/constants");
|
|
11
11
|
const pureUtil_1 = require("./pureUtil");
|
|
12
12
|
const InternalMetricsTrackingSingleton_1 = require("./InternalMetricsTrackingSingleton");
|
|
13
|
+
exports.VALUE_TO_STRING_DEFAULT_LIMIT = 2048;
|
|
14
|
+
exports.TRUNCATED_MESSAGE_SUFFIX = '…[truncated]';
|
|
13
15
|
function logInternal(logLine, ...meta) {
|
|
14
16
|
loggingProvider_1.logger.debug(logLine, meta);
|
|
15
17
|
}
|
|
@@ -68,13 +70,24 @@ function logWebUIAndCliOutput(logLine, logLevel, executionContext, metadata) {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
exports.logWebUIAndCliOutput = logWebUIAndCliOutput;
|
|
71
|
-
function valueToString(value) {
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
function valueToString(value, maxLength = exports.VALUE_TO_STRING_DEFAULT_LIMIT) {
|
|
74
|
+
let stringValue;
|
|
75
|
+
if (typeof value === 'object') {
|
|
76
|
+
stringValue = JSON.stringify(value);
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
else {
|
|
79
|
+
stringValue = '' + value;
|
|
80
|
+
}
|
|
81
|
+
return maybeTruncateLongMessage(stringValue, maxLength);
|
|
76
82
|
}
|
|
77
83
|
exports.valueToString = valueToString;
|
|
84
|
+
function maybeTruncateLongMessage(message, maxLength) {
|
|
85
|
+
return message.length <= maxLength
|
|
86
|
+
? message
|
|
87
|
+
: message.slice(0, maxLength - exports.TRUNCATED_MESSAGE_SUFFIX.length) +
|
|
88
|
+
exports.TRUNCATED_MESSAGE_SUFFIX;
|
|
89
|
+
}
|
|
90
|
+
exports.maybeTruncateLongMessage = maybeTruncateLongMessage;
|
|
78
91
|
function formatTimestamp(timeAsNumber) {
|
|
79
92
|
if (!timeAsNumber) {
|
|
80
93
|
return '';
|