From 1a6bc2cca37d0d28961c11a4744759628e045472 Mon Sep 17 00:00:00 2001 From: Surya Tripathi Date: Tue, 13 Oct 2020 21:59:12 +0530 Subject: [PATCH] check for bsConfig.run_settings.cypressProjectDir existance --- bin/helpers/usageReporting.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/helpers/usageReporting.js b/bin/helpers/usageReporting.js index 1cd68e45..9a25c7ef 100644 --- a/bin/helpers/usageReporting.js +++ b/bin/helpers/usageReporting.js @@ -33,7 +33,7 @@ function local_cypress_version(bsConfig) { // 1. check version of Cypress installed in local project // 2. check version of Cypress installed globally if not present in project - if (bsConfig) { + if (bsConfig && bsConfig.run_settings.cypressProjectDir) { let version = get_version(path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', '.bin', 'cypress')); if (!version) { version = get_version('cypress'); @@ -80,7 +80,7 @@ function cli_version_and_path(bsConfig) { // 1. check version of Cypress installed in local project // 2. check version of Cypress installed globally if not present in project - if (bsConfig) { + if (bsConfig && bsConfig.run_settings.cypressProjectDir) { let _path = path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', 'browserstack-cypress'); let version = get_version(_path); if (!version) {