Move global declaration to one place where it will be required, and ensure that is required during tests