Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonTClipp committed Feb 13, 2024
1 parent 587f197 commit 1805cf2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ func TestNewConfigFromViper(t *testing.T) {
Case: "camel",
Dir: ".",
Output: "./mocks",
Style: "mockery",
},
},
{
Expand All @@ -919,11 +920,13 @@ packages:
want: &Config{
Dir: "mocks/{{.PackagePath}}",
FileName: "mock_{{.InterfaceName}}.go",
Formatter: "goimports",
IncludeAutoGenerated: true,
MockName: "Mock{{.InterfaceName}}",
Outpkg: "{{.PackageName}}",
WithExpecter: true,
LogLevel: "info",
Style: "mockery",
},
},
{
Expand All @@ -937,11 +940,13 @@ packages:
want: &Config{
Dir: "barfoo",
FileName: "foobar.go",
Formatter: "goimports",
IncludeAutoGenerated: true,
MockName: "Mock{{.InterfaceName}}",
Outpkg: "{{.PackageName}}",
WithExpecter: true,
LogLevel: "info",
Style: "mockery",
},
},
}
Expand Down Expand Up @@ -974,9 +979,7 @@ packages:
got._cfgAsMap = nil
tt.want._cfgAsMap = nil

if !reflect.DeepEqual(got, tt.want) {
t.Errorf("NewConfigFromViper() = %v, want %v", got, tt.want)
}
assert.Equal(t, tt.want, got)
})
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/fixtures/variadic.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ type VariadicFunction = func(args1 string, args2 ...interface{}) interface{}
type Variadic interface {
VariadicFunction(str string, vFunc VariadicFunction) error
}

4 changes: 3 additions & 1 deletion pkg/outputter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ func TestOutputter_Generate(t *testing.T) {
}
for _, tt := range tests {
if tt.fields.config == nil {
tt.fields.config = &config.Config{}
tt.fields.config = &config.Config{
Style: "mockery",
}
}
tt.fields.config.Dir = t.TempDir()
tt.fields.config.MockName = "Mock{{.InterfaceName}}"
Expand Down

0 comments on commit 1805cf2

Please sign in to comment.