pizza-cli
pizza-cli copied to clipboard
Bug: config tests do not account for developer's home `~/.sauced.yaml` config
Describe the bug
There are still flakey tests:
--- FAIL: TestLoadConfig (0.00s)
--- FAIL: TestLoadConfig/Non-existent_file (0.00s)
config_test.go:51:
Error Trace: /Users/jpmcb/workspace/opensauced/pizza-cli/pkg/config/config_test.go:51
Error: An error is expected but got nil.
Test: TestLoadConfig/Non-existent_file
which do not account for a developer's home ~/.sauced.yaml
Steps to reproduce
- Create a home
~/.sauced.yaml
- Run tests via
just test
- See ^ test fail
This is fixed by moving the home config:
❯ mv ~/.sauced.yaml ~/.meow.yaml
Tests should not make an assumption based on the developer's environment. These kind of tests would be better in isolated e2e tests.