@wdio/config
Advanced tools
Comparing version 9.0.0-alpha.78 to 9.0.0-alpha.113
import path from 'node:path'; | ||
import logger from '@wdio/logger'; | ||
import { deepmerge } from 'deepmerge-ts'; | ||
import { deepmerge, deepmergeCustom } from 'deepmerge-ts'; | ||
import RequireLibrary from './RequireLibrary.js'; | ||
@@ -10,2 +10,3 @@ import FileSystemPathService from './FileSystemPathService.js'; | ||
const log = logger('@wdio/config:ConfigParser'); | ||
const MERGE_DUPLICATION = ['services', 'reporters']; | ||
export default class ConfigParser { | ||
@@ -137,4 +138,17 @@ _initialConfig; | ||
const exclude = Array.isArray(object.exclude) ? object.exclude : []; | ||
this._config = deepmerge(this._config, object); | ||
/** | ||
* Add deepmergeCustom to remove array('services', 'reporters', 'capabilities') duplication in the config object | ||
*/ | ||
const customDeepMerge = deepmergeCustom({ | ||
mergeArrays: ([oldValue, newValue], utils, meta) => { | ||
const key = meta?.key; | ||
if (meta && MERGE_DUPLICATION.includes(key)) { | ||
const origWithoutObjectEntries = oldValue.filter((value) => typeof value !== 'object'); | ||
return Array.from(new Set(deepmerge(newValue, origWithoutObjectEntries))); | ||
} | ||
return utils.actions.defaultMerge; | ||
} | ||
}); | ||
this._config = customDeepMerge(this._config, object); | ||
/** | ||
* overwrite config specs that got piped into the wdio command, | ||
@@ -141,0 +155,0 @@ * also adhering to the wdio-prefixes from a capability |
{ | ||
"name": "@wdio/config", | ||
"version": "9.0.0-alpha.78+fee2f8a88", | ||
"version": "9.0.0-alpha.113+ceeac488e", | ||
"description": "A helper utility to parse and validate WebdriverIO options", | ||
@@ -39,5 +39,5 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
"dependencies": { | ||
"@wdio/logger": "9.0.0-alpha.78+fee2f8a88", | ||
"@wdio/types": "9.0.0-alpha.78+fee2f8a88", | ||
"@wdio/utils": "9.0.0-alpha.78+fee2f8a88", | ||
"@wdio/logger": "9.0.0-alpha.113+ceeac488e", | ||
"@wdio/types": "9.0.0-alpha.113+ceeac488e", | ||
"@wdio/utils": "9.0.0-alpha.113+ceeac488e", | ||
"decamelize": "^6.0.0", | ||
@@ -54,3 +54,3 @@ "deepmerge-ts": "^5.0.0", | ||
}, | ||
"gitHead": "fee2f8a88d132537795eaf144abf1a7e242f99ff" | ||
"gitHead": "ceeac488e86da4d6ffad891632183085e4332be7" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
48526
993