Skip to content

Commit

Permalink
Use testify/require instead of testify/assert
Browse files Browse the repository at this point in the history
Don't continue to run a test if it has already failed
  • Loading branch information
stv0g authored and Sean-Der committed Mar 23, 2024
1 parent fdca6c4 commit 05ab684
Show file tree
Hide file tree
Showing 19 changed files with 533 additions and 572 deletions.
9 changes: 4 additions & 5 deletions active_tcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/pion/logging"
"github.com/pion/transport/v3/stdnet"
"github.com/pion/transport/v3/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -199,12 +198,12 @@ func TestActiveTCP_NonBlocking(t *testing.T) {
if err != nil {
t.Fatal(err)
}
assert.NoError(t, aAgent.AddRemoteCandidate(invalidCandidate))
assert.NoError(t, bAgent.AddRemoteCandidate(invalidCandidate))
require.NoError(t, aAgent.AddRemoteCandidate(invalidCandidate))
require.NoError(t, bAgent.AddRemoteCandidate(invalidCandidate))

connect(aAgent, bAgent)

<-isConnected
assert.NoError(t, aAgent.Close())
assert.NoError(t, bAgent.Close())
require.NoError(t, aAgent.Close())
require.NoError(t, bAgent.Close())
}
3 changes: 1 addition & 2 deletions agent_get_best_valid_candidate_pair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package ice
import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand All @@ -28,7 +27,7 @@ func TestAgentGetBestValidCandidatePair(t *testing.T) {
require.Equal(t, actualBestPair.String(), expectedBestPair.String())
}

assert.NoError(t, f.sut.Close())
require.NoError(t, f.sut.Close())
}

func setupTestAgentGetBestValidCandidatePair(t *testing.T) *TestAgentGetBestValidCandidatePairFixture {
Expand Down

0 comments on commit 05ab684

Please sign in to comment.