Skip to content

Commit

Permalink
test(nuke): fix error handling on test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 15, 2024
1 parent 5c14183 commit 701926d
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pkg/nuke/nuke_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"io"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -146,20 +145,6 @@ func Test_Nuke_Filters_NoMatch(t *testing.T) {
}

func Test_Nuke_Filters_ErrorCustomProps(t *testing.T) {
logrus.AddHook(&TestGlobalHook{
t: t,
tf: func(t *testing.T, e *logrus.Entry) {
if strings.HasSuffix(e.Caller.File, "pkg/nuke/nuke.go") {
return
}

if e.Caller.Line == 467 {
assert.Equal(t, "*nuke.TestResource does not support custom properties", e.Message)
}
},
})
defer logrus.StandardLogger().ReplaceHooks(make(logrus.LevelHooks))

registry.ClearRegistry()
registry.Register(TestResourceRegistration)

Expand All @@ -186,7 +171,8 @@ func Test_Nuke_Filters_ErrorCustomProps(t *testing.T) {
assert.NoError(t, sErr)

err := n.Scan(context.TODO())
assert.NoError(t, err)
assert.Error(t, err)
assert.Equal(t, "*nuke.TestResource does not support custom properties", err.Error())
}

type TestResourceFilter struct {
Expand Down

0 comments on commit 701926d

Please sign in to comment.