guyellis / http-status-check

Checks a site's HTTP status
MIT License
33 stars 31 forks source link

site.followRedirect needs unit tests #19

Open guyellis opened 9 years ago

guyellis commented 9 years ago

In uriCheck.js we set followRedirect to false. This should be configurable per site and default to false if missing which will allow for checking collections of shortUrls and their ultimate destinations.

ckross01 commented 9 years ago

looking for a config based approach for the setting or do you just want it passed into the uriCheck module from the manager?

guyellis commented 9 years ago

I'm thinking that it should be part of the site object that's passed into the checkUri() function. So when the options object is setup around lines 28 to 31 the followRedirect is set to !!site.followRedirect. That way everything should continue to function as usual but it can be set to true for any site in the samplesites.js or for all sites using the allSites object. Does that make sense?

guyellis commented 9 years ago

site.followRedirect has been added, however it needs unit tests. Probably using something like sinon to stub request.