Skip to content

Commit

Permalink
fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickathompson authored and Patrick Thompson committed Aug 5, 2024
1 parent becd08f commit b9f0ff4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,27 @@ module.exports = {
},

_getCapabilitiesFromConfig () {
const configPath = String(path.relative(__dirname, path.resolve(process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH)));
const configPath = path.resolve(process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH);

if (!configPath)
return {};
const relativeConfigPath = path.relative(__dirname, configPath);

return require(configPath);
if (!relativeConfigPath)
return {};
return require(relativeConfigPath);
},

_getAdditionalCapabilities () {
const capabilitiesFromEnvironment = pickBy(this._getCapabilitiesFromEnvironment(), value => value !== void 0);
let additionalCapabilities = '';

if (process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH)
additionalCapabilities = { ...this._getCapabilitiesFromConfig(), ...capabilitiesFromEnvironment };
else
additionalCapabilities = { ...capabilitiesFromEnvironment };

return { ...this._getCapabilitiesFromConfig(), ...capabilitiesFromEnvironment };
return additionalCapabilities;
},

_filterPlatformInfo (query) {
Expand Down

0 comments on commit b9f0ff4

Please sign in to comment.