I'm learning TDD (in Javascript), and I wanted to know, what is the right way to use configuration variables? Should I make a separate class and have them be member variables of the class, and pass an instance of the class to every object that needs it, or make a list of global variables and just use those? What are the benefits / setbacks of each method?
For example, I have to get data from a URL as follows:
function getData (remoteDataDelegate) {
remoteDataDelegate.getData(userInfoURL)
}
where userInfoURL
is a configuration variable that I set elsewhere to the URL for a page on my site.