MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / updateConfig

Function updateConfig

lib/command/utils.js:46–60  ·  view source on GitHub ↗
(testsPath, config, extension)

Source from the content-addressed store, hash-verified

44export { fail }
45
46function 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
62export { updateConfig }
63

Callers 1

init.jsFile · 0.90

Calls 3

fileExistsFunction · 0.90
beautifyFunction · 0.90
logMethod · 0.80

Tested by

no test coverage detected