Skip to content

Commit d91feb7

Browse files
committed
additional tests
1 parent 8e4967c commit d91feb7

File tree

4 files changed

+63
-77
lines changed

4 files changed

+63
-77
lines changed

.mockery_testify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ packages:
128128
pkg-path: github.com/vektra/mockery/v3/internal/fixtures/replace_type_pointers
129129
type-name: Bar
130130
github.com/vektra/mockery/v3/internal/fixtures/directive_comments:
131+
config:
132+
all: False
131133
interfaces:
132134
MatryerRequester:
133135
config:
134136
structname: TheMatryerRequester
137+
InterfaceWithoutGenerate:
135138
ServerWithDifferentFile:
136139
configs:
137140
- structname: FunServerWithDifferentFile

internal/fixtures/directive_comments/directive_comments.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ type ServerWithDifferentFile interface {
4141
type InterfaceWithGenerateFalse interface {
4242
DoSomething()
4343
}
44+
45+
// Interfaces without `generate: true` directive should still be generated
46+
// if the interface would have otherwise been included and there are other
47+
// mockery configs present in the doc comment.
48+
//
49+
//mockery:structname: InterfaceWithoutGenerateFoo
50+
type InterfaceWithoutGenerate interface {
51+
Foo()
52+
}

internal/fixtures/directive_comments/directive_comments_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ func TestInterfaceAnnotations(t *testing.T) {
4444
assert.Contains(t, customFile, "type AnotherFunServerWithDifferentFile struct")
4545

4646
assert.NotContains(t, testifyMock, "MockInterfaceWithGenerateFalse")
47+
assert.Contains(t, testifyMock, "InterfaceWithoutGenerateFoo")
4748
}

internal/fixtures/directive_comments/mocks_testify_directive_comments_test.go

Lines changed: 50 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)