test the error to ensure there isn't an unexpected error in the test

This commit is contained in:
Edward Muller
2019-10-13 17:45:01 -07:00
parent f9951ccddd
commit 46015a925f
3 changed files with 14 additions and 5 deletions
+3 -1
View File
@@ -211,6 +211,8 @@ func TestHookFireOrder(t *testing.T) {
h.Add(&HookCallFunc{F: func() { checkers = append(checkers, "second hook") }})
h.Add(&HookCallFunc{F: func() { checkers = append(checkers, "third hook") }})
h.Fire(InfoLevel, &Entry{})
if err := h.Fire(InfoLevel, &Entry{}); err != nil {
t.Error("unexpected error:", err)
}
require.Equal(t, []string{"first hook", "second hook", "third hook"}, checkers)
}