I've entered login information during tests but I no longer want this data to be present in the source code which will be uploaded to GitHub soon. How can I make use of this data in the tests without storing the login info in the source code? Is it safe to store it in an environment variable? A database? A local file? What's the best way to go about encrypting and decrypting this info?
If your project working fine , you can use/add spy method in to code and validate/add unit test for the login file. (spyse used to get actual response from methods to test files, its inbuild feature in unit tests).
If you use secret for login, anybody can add console and check your credentials, I'm not sure that's good idea if you upload to github.
How to use sensitive data in unit tests?