Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhang committed Feb 10, 2022
1 parent 3d678d3 commit 5a386a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions decorate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,11 @@ func TestDecorateFailure(t *testing.T) {
return &Logger{Name: "root"}
}),
fx.Module("child",
fx.Decorate(func(l *Logger) (*Logger, error) {
return &Logger{Name: l.Name + "decorated"}, errors.New("minor sadness")
fx.Decorate(func(l *Logger) *Logger {
return &Logger{Name: l.Name + "decorated"}
}),
fx.Decorate(func(l *Logger) *Logger {
return &Logger{Name: l.Name + "decorated"}
}),
fx.Invoke(func(l *Logger) {
assert.Fail(t, "this should not be executed")
Expand All @@ -259,7 +262,7 @@ func TestDecorateFailure(t *testing.T) {

err := app.Err()
require.Error(t, err)
assert.Contains(t, err.Error(), "minor sadness")
assert.Contains(t, err.Error(), "*fx_test.Logger already decorated")
})

t.Run("decorating a type more than once in the same Module errors", func(t *testing.T) {
Expand Down

0 comments on commit 5a386a0

Please sign in to comment.