Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// Hide the `topResult` action in action list (because this update does not overwrite `topResult`).
delete actions.e
}
// Print prompt choices.
util.log()
for (var actionKey in actions) {
util.log(actionKey, '-', actions[actionKey])
}
// Require user to input one of the specified action keys.
var actionKeys = Object.keys(actions)
var query = '(' + (testIndex + 1) + ' of ' + tests.length + ') Overwrite this test [' + actionKeys + ']? '
var actionKey = readlineSync.keyIn(util.colors.bold.blue(query), {
limit: actionKeys,
caseSensitive: true,
})
switch (actionKey) {
case 'y':
// Overwrite this entire test.
return true
case 'e':
// Restore original `topResult` in new test.
util.log('Original `topResult` restored.')
newTest.topResult = existingTest.topResult
return true
case 'n':
// Skip this test.
return false