chromium / hstspreload

🔒🔍 A Go package to scan sites against requirements for Chromium-maintained HSTS preload list.
https://hstspreload.org
BSD 3-Clause "New" or "Revised" License
116 stars 37 forks source link

End-to-end tests #46

Closed lgarron closed 8 years ago

lgarron commented 8 years ago

In particular, testing checkDomain against a local test server.

lgarron commented 8 years ago

I spent an hour looking into httptest and other TLSDialer hacks.

For now, I think it's better to use only unit tests, and use public servers for "end-to-end" tests where possible. For example, httbpin.org was sufficient to test redirect handling in 7796d74ead064312d11ece52d7bb7575a2ac7c80 because we can test the helper function (which takes a URL rather than a domain) directly.