Skip to content

Commit

Permalink
Add test coverage for TestResult.Helpers (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantv authored Jan 14, 2025
1 parent 0bfb0f6 commit efd4ee0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions faket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ func TestFakeT_FailSkip(t *testing.T) {
want.Equal(t, "Failed", tr.Failed(), true)
want.Equal(t, "FailedAndSkipped", tr.FailedAndSkipped(), true)
}

func TestFakeT_Helpers(t *testing.T) {
tr := RunTest(func(t testing.TB) {
testHelper1(t)
testHelper2(t)
testHelper3(t)
})
want.DeepEqual(t, "Helpers", tr.Helpers(), []string{
"github.com/prashantv/faket.testHelper1",
"github.com/prashantv/faket.testHelper3",
})
}

func testHelper1(t testing.TB) { t.Helper() }
func testHelper2(t testing.TB) {}
func testHelper3(t testing.TB) { t.Helper() }

0 comments on commit efd4ee0

Please sign in to comment.