From 32829e07bf518135e2236b875786e7f1bcc96159 Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Sun, 21 Aug 2022 13:07:18 -0700 Subject: [PATCH] Annotated test: Use NewForTest The table tests in fx OnStart/OnStop hooks tests weren't using NewForTest so they end up polluting the failure logs when there are tests failing. --- annotated_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) })