Skip to content

Commit

Permalink
chore: app_test.go: New->NewForTest (#1004)
Browse files Browse the repository at this point in the history
The tests that cover error cases for private provides were using
New(opts...) rather than NewForTest(t, opts...) which caused the error
logs to be present in the tests when those tests run.

This changes those to use NewForTest instead.
  • Loading branch information
sywhang authored Dec 27, 2022
1 parent 56aa0d5 commit 0cae538
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func TestPrivateProvide(t *testing.T) {
t.Run("CantUsePrivateFromSubModule", func(t *testing.T) {
t.Parallel()

app := New(
app := NewForTest(t,
Module("SubModule", Provide(func() int { return 0 }, Private)),
Invoke(func(a int) {}),
)
Expand Down Expand Up @@ -447,7 +447,7 @@ func TestPrivateProvideWithDecorators(t *testing.T) {
if private {
provideOpts = append(provideOpts, Private)
}
app := New(
app := NewForTest(t,
Module("SubModule",
Provide(provideOpts...),
Decorate(func(a int) int { return a + 2 }),
Expand Down Expand Up @@ -500,7 +500,7 @@ func TestPrivateProvideWithDecorators(t *testing.T) {
t.Run("CannotDecoratePrivateChildType", func(t *testing.T) {
t.Parallel()

app := New(
app := NewForTest(t,
Module("Child",
Provide(func() int { return 0 }, Private),
),
Expand Down

0 comments on commit 0cae538

Please sign in to comment.