Closed sebastus closed 3 years ago
Looking at how the various pkgs can be refactored as interfaces so that mocks can be written.
Initial unit test has 99.9% of what's needed to do an integration test. One line of code has to change: (file is runFromCLI_test.go)
getActionMap()
action := cmd.ActionMap["mock"]
console.DebugEnabled = true
action.Execute(&optionsList[0])
to:
getActionMap()
action := cmd.ActionMap[cmd.Name()] <-- this
console.DebugEnabled = true
action.Execute(&optionsList[0])
integration testing may use terratest, but in general the pattern is: