UNPKG

e2ed

Version:

E2E testing framework over Playwright

32 lines (31 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.updateConfig = void 0; const object_1 = require("../object"); const skippedFields = [ 'doAfterPack', 'doBeforePack', 'fullMocks', 'matchScreenshot', ]; /** * Updates full pack config by values from `startInfo` (getted by `doBeforePack` functions). * @internal */ const updateConfig = (fullPackConfig, startInfo) => { for (const field of new Set([...(0, object_1.getKeys)(fullPackConfig), ...(0, object_1.getKeys)(startInfo.fullPackConfig)])) { if (skippedFields.includes(field)) { continue; } if (typeof fullPackConfig[field] === 'function') { continue; } // @ts-expect-error: full pack config have different types of field values fullPackConfig[field] = startInfo.fullPackConfig[field]; // eslint-disable-line no-param-reassign } Object.assign(fullPackConfig, { ...fullPackConfig.overriddenConfigFields, use: { ...fullPackConfig.use, ...fullPackConfig.overriddenConfigFields?.use }, }); }; exports.updateConfig = updateConfig;