1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
package errortracking
import (
"testing"
"github.com/getsentry/sentry-go"
"github.com/stretchr/testify/require"
)
func Test_applyCaptureOptions(t *testing.T) {
tests := []struct {
name string
opts []CaptureOption
wantConfig captureConfig
wantEventLevel sentry.Level
}{
{
name: "default",
opts: []CaptureOption{},
wantConfig: captureConfig{},
wantEventLevel: sentry.LevelError,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotConfig, gotEvent := applyCaptureOptions(tt.opts)
gotEventLevel := gotEvent.Level
require.Equalf(t, gotConfig, tt.wantConfig, "applyCaptureOptions() = %v, want %v", gotConfig, tt.wantConfig)
require.Equalf(t, gotEventLevel, tt.wantEventLevel, "applyCaptureOptions() Event.Level = %v, want %v", gotEventLevel, tt.wantEventLevel)
})
}
}
|