(testsPath, config, extension)
| 44 | export { fail } |
| 45 | |
| 46 | function updateConfig(testsPath, config, extension) { |
| 47 | const configFile = path.join(testsPath, `codecept.conf.${extension}`) |
| 48 | if (!fileExists(configFile)) { |
| 49 | const msg = `codecept.conf.${extension} config can\'t be updated automatically` |
| 50 | console.log() |
| 51 | console.log(`${output.colors.bold.red(msg)}`) |
| 52 | console.log(`${output.colors.bold.red('Please update it manually:')}`) |
| 53 | console.log() |
| 54 | console.log(config) |
| 55 | console.log() |
| 56 | return |
| 57 | } |
| 58 | console.log(`${output.colors.yellow('Updating configuration file...')}`) |
| 59 | return fs.writeFileSync(configFile, beautify(`exports.config = ${util.inspect(config, false, 4, false)}`), 'utf-8') |
| 60 | } |
| 61 | |
| 62 | export { updateConfig } |
| 63 |
no test coverage detected