I am using AWS Cognito with MFA and I can't use an actual user with a session to test the routes in with supertest testcases.
What is the best practice for testing authenticated routes without getting a valid token?
I tried to login with an actual user, but I can't do that because I have MFA required.
I ended up having an environment variable, to check if we are in a test environment and then create the routs without authentication.
I don't know if there are better ways.