From e3aa1aaea340c88897ad42428fb0f26018cf7eeb Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Mon, 18 Nov 2019 13:34:26 +0700 Subject: [PATCH] js: NotNil -> Error --- js/runner_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/runner_test.go b/js/runner_test.go index 94b452d321a..7ac4e4cc2a5 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -682,7 +682,7 @@ func TestVUIntegrationInsecureRequests(t *testing.T) { } err = vu.RunOnce(context.Background()) if data.errMsg != "" { - require.NotNil(t, err) + require.Error(t, err) assert.Contains(t, err.Error(), data.errMsg) } else { assert.NoError(t, err) @@ -723,7 +723,7 @@ func TestVUIntegrationBlacklistOption(t *testing.T) { return } err = vu.RunOnce(context.Background()) - require.NotNil(t, err) + require.Error(t, err) assert.Contains(t, err.Error(), "IP (10.1.2.3) is in a blacklisted range (10.0.0.0/8)") }) } @@ -759,7 +759,7 @@ func TestVUIntegrationBlacklistScript(t *testing.T) { return } err = vu.RunOnce(context.Background()) - require.NotNil(t, err) + require.Error(t, err) assert.Contains(t, err.Error(), "IP (10.1.2.3) is in a blacklisted range (10.0.0.0/8)") }) } @@ -877,7 +877,7 @@ func TestVUIntegrationTLSConfig(t *testing.T) { } err = vu.RunOnce(context.Background()) if data.errMsg != "" { - require.NotNil(t, err) + require.Error(t, err) assert.Contains(t, err.Error(), data.errMsg) } else { assert.NoError(t, err) @@ -1174,7 +1174,7 @@ func TestVUIntegrationClientCerts(t *testing.T) { vu, err := r.NewVU(make(chan stats.SampleContainer, 100)) if assert.NoError(t, err) { err := vu.RunOnce(context.Background()) - require.NotNil(t, err) + require.Error(t, err) assert.Contains(t, err.Error(), "remote error: tls: bad certificate") } })