MCPcopy
hub / github.com/ossf/scorecard / TestCITestsRuntimeError

Function TestCITestsRuntimeError

checks/ci_tests_test.go:27–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestCITestsRuntimeError(t *testing.T) {
28 t.Parallel()
29
30 ctrl := gomock.NewController(t)
31 mockRepoClient := mockrepo.NewMockRepoClient(ctrl)
32 mockRepoClient.EXPECT().ListCommits().Return(nil, fmt.Errorf("some runtime error")).AnyTimes()
33
34 req := checker.CheckRequest{
35 RepoClient: mockRepoClient,
36 }
37 res := CITests(&req)
38
39 want := "CI-Tests"
40 if res.Name != want {
41 t.Errorf("got: %q, want: %q", res.Name, want)
42 }
43 ctrl.Finish()
44}

Callers

nothing calls this directly

Calls 3

EXPECTMethod · 0.95
CITestsFunction · 0.70
ListCommitsMethod · 0.65

Tested by

no test coverage detected