diff --git a/annotated_test.go b/annotated_test.go index d252e9d6e..4b4c6db08 100644 --- a/annotated_test.go +++ b/annotated_test.go @@ -1443,9 +1443,8 @@ func TestHookAnnotationFailures(t *testing.T) { return } - app := fx.New(opts) - ctx := context.Background() - err := app.Start(ctx) + app := NewForTest(t, opts) + err := app.Start(context.Background()) require.Error(t, err) require.Contains(t, err.Error(), tt.errContains) })