Skip to content

Commit

Permalink
Fix wrong types in tests.
Browse files Browse the repository at this point in the history
Config.AllowedDomains is an array of string, not a string. These tests
couldn't have ever passed 🙃

Fixing now cos it's blocking updates for critical fixes to the net
library.
  • Loading branch information
sengi committed Oct 18, 2023
1 parent cdcb77b commit 01252cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/crawler/crawler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func newTestServer(t *testing.T) *httptest.Server {
func TestNewCrawler(t *testing.T) {
cfg := &config.Config{
UserAgent: "custom-agent",
AllowedDomains: "example.com",
AllowedDomains: []string{"example.com"},
DisallowedURLFilters: []*regexp.Regexp{
regexp.MustCompile(".*disallowed.*"),
},
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestRun(t *testing.T) {
// Create a new crawler instance
cfg := &config.Config{
Site: ts.URL + "/sitemap.xml",
AllowedDomains: hostname,
AllowedDomains: []string{hostname},
DisallowedURLFilters: []*regexp.Regexp{
regexp.MustCompile("/disallowed"),
},
Expand Down

0 comments on commit 01252cf

Please sign in to comment.