Skip to content

Commit 902ec25

Browse files
committed
added more logs
1 parent 19e2bd6 commit 902ec25

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/helpers/readCypressConfigUtil.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,33 +70,40 @@ exports.loadJsFile = (cypress_config_filepath, bstack_node_modules_path) => {
7070
load_command = `set NODE_PATH=${bstack_node_modules_path}&& node "${require_module_helper_path}" "${cypress_config_filepath}"`
7171
}
7272
logger.debug(`Running: ${load_command}`)
73+
console.log(`Running: ${load_command}`)
7374
cp.execSync(load_command)
7475
const cypress_config = JSON.parse(fs.readFileSync(config.configJsonFileName).toString())
7576
if (fs.existsSync(config.configJsonFileName)) {
7677
fs.unlinkSync(config.configJsonFileName)
7778
}
79+
console.log('Loaded Cypress config:', cypress_config)
7880
return cypress_config
7981
}
8082

8183
exports.readCypressConfigFile = (bsConfig) => {
84+
console.log('Reading Cypress config file:', JSON.stringify(bsConfig));
8285
const cypress_config_filepath = path.resolve(bsConfig.run_settings.cypressConfigFilePath)
8386
try {
8487
const cypress_config_filename = bsConfig.run_settings.cypress_config_filename
8588
const bstack_node_modules_path = path.join(path.resolve(config.packageDirName), 'node_modules')
8689
const conf_lang = this.detectLanguage(cypress_config_filename)
8790

8891
logger.debug(`cypress config path: ${cypress_config_filepath}`);
92+
console.log(`cypress config path: ${cypress_config_filepath}`);
8993

9094
if (conf_lang == 'js' || conf_lang == 'cjs') {
95+
console.log('Detected config language:', conf_lang)
9196
return this.loadJsFile(cypress_config_filepath, bstack_node_modules_path)
9297
} else if (conf_lang === 'ts') {
98+
console.log('Detected config language:', conf_lang)
9399
const compiled_cypress_config_filepath = this.convertTsConfig(bsConfig, cypress_config_filepath, bstack_node_modules_path)
94100
return this.loadJsFile(compiled_cypress_config_filepath, bstack_node_modules_path)
95101
}
96102
} catch (error) {
97103
const errorMessage = `Error while reading cypress config: ${error.message}`
98104
const errorCode = 'cypress_config_file_read_failed'
99105
logger.error(errorMessage)
106+
console.log("error:", errorMessage)
100107
utils.sendUsageReport(
101108
bsConfig,
102109
null,
@@ -112,5 +119,6 @@ exports.readCypressConfigFile = (bsConfig) => {
112119
if (fs.existsSync(complied_js_dir)) {
113120
fs.rmdirSync(complied_js_dir, { recursive: true })
114121
}
122+
console.log('Cleaned up compiled JS directory:', complied_js_dir)
115123
}
116124
}

0 commit comments

Comments
 (0)