Skip to content

Commit

Permalink
refactor: Get config.Validate() under test
Browse files Browse the repository at this point in the history
We have an entrypoint for validating the Repositories schema, so
use it when validating, to ensure test coverage.  All the other
tests will use the validator in the test suite.

Fixes: Issue #106
  • Loading branch information
nisimond authored and retr0h committed Jan 3, 2024
1 parent 3dac49f commit f10b277
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/config/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ func (suite *SchemaTestSuite) TestRepositories() {
}, "Key: 'Repositories.Repositories' Error:Field validation for 'Repositories' failed on the 'required' tag"},
}

// NOTE(nic): we have an entrypoint for validating this schema, so use it to
// ensure test coverage. All the other tests will use the validator in the suite.
for _, test := range tests {
err := suite.v.Struct(test.param)
err := Validate(test.param)
if test.expected != "" {
assert.EqualError(suite.T(), err, test.expected)
} else {
Expand Down

0 comments on commit f10b277

Please sign in to comment.