test: fix issue with environment variables being set
Description
Having certain environment variables set (namely GITLAB_TOKEN, VISUAL, EDITOR) can cause some of the tests to fail when running the full CLI test suite. This MR DRYs up the function to clear them, adds a few more, and fixes a typo.
How has this been tested?
- Set
GITLAB_TOKEN,VISUAL, andEDITORin your shell - Run the CLI test suite:
go test ./... - Get no failures!
🤞
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Gary Holtz