From 2d3cd6584dedce45ea709d1757a28ce7537f3472 Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 30 Oct 2023 19:02:50 +0100 Subject: Refactor to prepare for builtin JS functions --- modules/proxy/proxy_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'modules/proxy/proxy_test.go') diff --git a/modules/proxy/proxy_test.go b/modules/proxy/proxy_test.go index e6058b8..62da23a 100644 --- a/modules/proxy/proxy_test.go +++ b/modules/proxy/proxy_test.go @@ -20,13 +20,17 @@ func TestProxy(t *testing.T) { p := newProxy(func() { called = true }) defer p.Close() - scraper := flyscrape.NewScraper() - scraper.LoadModule(&starturl.Module{URL: "http://www.example.com"}) - scraper.LoadModule(&proxy.Module{ - Proxies: []string{p.URL}, - }) + mods := []flyscrape.Module{ + &starturl.Module{URL: "http://www.example.com"}, + &proxy.Module{ + Proxies: []string{p.URL}, + }, + } + scraper := flyscrape.NewScraper() + scraper.Modules = mods scraper.Run() + require.True(t, called) } -- cgit v1.2.3