Add goleak in unit tests

This commit is contained in:
Jamie Curnow committed 2023-11-08 09:57:15 +10:00
1 parent 689bcb0077
commit 6da020aab1
41 files changed
+371 -8

No files matched your search

+4
View File
@@ -7,9 +7,13 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/goleak"
)
func TestGetHostFilename(t *testing.T) {
// goleak is used to detect goroutine leaks
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
test.InitConfig(t)
tests := []struct {
name string
+4
View File
@@ -10,9 +10,13 @@ import (
"npm/internal/types"
"github.com/stretchr/testify/assert"
"go.uber.org/goleak"
)
func TestRenderTemplate(t *testing.T) {
// goleak is used to detect goroutine leaks
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
test.InitConfig(t)
template := `