Skip to content

Report missing files position within test function - #318

Open
shagohead wants to merge 1 commit into
uber-go:mainfrom
shagohead:main
Open

shagohead wants to merge 1 commit into
uber-go:mainfrom
shagohead:main

Conversation

@shagohead

Copy link
Copy Markdown

Example:

// report_test.go
package gomock_test

import (
	"testing"

	"go.uber.org/mock/gomock"
)

func TestMissingCalls(t *testing.T) {
	ctrl := gomock.NewController(t)
	mock := NewMockFoo(ctrl)
	mock.EXPECT().Bar(gomock.Any()).Return("foo")
}

Was:

--- FAIL: TestMissingCalls (0.00s)
    controller.go:98: missing call(s) to *gomock_test.MockFoo.Bar(is anything) /Users/shagohead/src/github.com/uber-go/mock/gomock/report_test.go:12
    controller.go:98: aborting test due to missing call(s)

Becomes:

--- FAIL: TestMissingCalls (0.00s)
    report_test.go:10: missing call(s) to *gomock_test.MockFoo.Bar(is anything) /Users/shagohead/src/github.com/uber-go/mock/gomock/report_test.go:12
    report_test.go:10: aborting test due to missing call(s)

Resolves #317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report missing calls file position within test function

1 participant