Skip to content

Commit

Permalink
Add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Apr 23, 2021
1 parent f548f54 commit 1522595
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/zipurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ func TestZipUrlWithSameEtag(t *testing.T) {
require.Equal(t, zus.TargetDirectory, target, "Target directory should be same")
}

func TestZipUrlWithBadUrl(t *testing.T) {
_, teardown := setupTests()
defer teardown()

zus := ZipURLSource{
URL: "http://notahost.notadomaintoehutoeuhn",
Folder: "/",
Retries: 2,
}
err := zus.Fetch()
defer zus.Close()
require.Error(t, err)
}

func setupTests() (addr string, teardown func()) {
// go offline, so we dont invoke npm install for unit tests
GoOffline()
Expand Down

0 comments on commit 1522595

Please sign in to comment.