e2ed
Version:
E2E testing framework over Playwright
18 lines (17 loc) • 761 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateStepPayload = void 0;
const config_1 = require("../config");
const object_1 = require("../object");
/**
* Updates `step` log payload with the values returned by the step body.
* @internal
*/
const updateStepPayload = (logEvent, additionalPayload) => {
const { mapLogPayloadInReport } = (0, config_1.getFullPackConfig)();
const payloadInReport = mapLogPayloadInReport(logEvent.message, additionalPayload, logEvent.type);
if (payloadInReport !== undefined && payloadInReport !== 'skipLog') {
(0, object_1.setReadonlyProperty)(logEvent, 'payload', { ...logEvent.payload, ...payloadInReport });
}
};
exports.updateStepPayload = updateStepPayload;