Added unit tests around the top level scope function, showErrorMessages.