(genPath)
| 273 | const healTemplate = fs.readFileSync(path.join(__dirname, '../template/heal.js'), 'utf8').toString() |
| 274 | |
| 275 | export async function heal(genPath) { |
| 276 | const testsPath = getTestRoot(genPath) |
| 277 | |
| 278 | let configFile = path.join(testsPath, `codecept.conf.${extension}`) |
| 279 | |
| 280 | if (!fileExists(configFile)) { |
| 281 | configFile = path.join(testsPath, `codecept.conf.${extension}`) |
| 282 | if (fileExists(configFile)) extension = 'ts' |
| 283 | } |
| 284 | |
| 285 | output.print('Creating basic heal recipes') |
| 286 | output.print(`Add your own custom recipes to ./heal.${extension} file`) |
| 287 | output.print('Require this file in the config file and enable heal plugin:') |
| 288 | output.print('--------------------------') |
| 289 | output.print(` |
| 290 | import './heal.js' |
| 291 | |
| 292 | export const config = { |
| 293 | // ... |
| 294 | plugins: { |
| 295 | heal: { |
| 296 | enabled: true |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | `) |
| 301 | |
| 302 | const healFile = path.join(testsPath, `heal.${extension}`) |
| 303 | if (!safeFileWrite(healFile, healTemplate)) return |
| 304 | output.success(`Heal recipes were created in ${healFile}`) |
| 305 | } |
| 306 | |
| 307 | export async function prompt(promptName, genPath) { |
| 308 | if (!promptName) { |
nothing calls this directly
no test coverage detected