Innovenergy_trunk/frontend/node_modules/testcafe/lib/dashboard/get-env-options.js

26 lines
4.0 KiB
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function parseBooleanVariable(value) {
return value === 'false' || value === '0' ? false : !!value;
}
function parseNumber(value) {
const parsed = value === void 0 ? Number.NaN : Number.parseInt(value, 10);
if (Number.isNaN(parsed))
return void 0;
return parsed;
}
function getEnvOptions() {
return {
url: process.env.TESTCAFE_DASHBOARD_URL,
token: process.env.TESTCAFE_DASHBOARD_TOKEN,
buildId: process.env.TESTCAFE_DASHBOARD_BUILD_ID,
isLogEnabled: parseBooleanVariable(process.env.TESTCAFE_DASHBOARD_ENABLE_LOG),
noScreenshotUpload: parseBooleanVariable(process.env.TESTCAFE_DASHBOARD_NO_SCREENSHOT_UPLOAD),
noVideoUpload: parseBooleanVariable(process.env.TESTCAFE_DASHBOARD_NO_VIDEO_UPLOAD),
responseTimeout: parseNumber(process.env.TESTCAFE_DASHBOARD_RESPONSE_TIMEOUT),
requestRetryCount: parseNumber(process.env.TESTCAFE_DASHBOARD_REQUEST_RETRY_COUNT),
};
}
exports.default = getEnvOptions;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWVudi1vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Rhc2hib2FyZC9nZXQtZW52LW9wdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxTQUFTLG9CQUFvQixDQUFFLEtBQWM7SUFDekMsT0FBTyxLQUFLLEtBQUssT0FBTyxJQUFJLEtBQUssS0FBSyxHQUFHLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQztBQUNoRSxDQUFDO0FBRUQsU0FBUyxXQUFXLENBQUUsS0FBYztJQUNoQyxNQUF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