diff --git a/src/index.js b/src/index.js index e25f93b..2c36927 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ import { parse as parseUrl } from 'url'; +import path from 'node:path'; import Promise from 'pinkie'; import { promisify } from 'util'; import parseCapabilities from 'desired-capabilities'; @@ -137,12 +138,12 @@ module.exports = { }, _getCapabilitiesFromConfig () { - const configPath = process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH; + const configPath = String(path.relative(__dirname, path.resolve(process.env.BROWSERSTACK_CAPABILITIES_CONFIG_PATH))); if (!configPath) return {}; - return require(configPath); + return require(configPath); }, _getAdditionalCapabilities () {