Skip to content

Commit d837451

Browse files
authored
fix: correct example config to use null and add validation test (#209)
1 parent c70abda commit d837451

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.testcoverage.example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ diff:
6060
# Allowed threshold for the test coverage difference (in percentage)
6161
# between the feature branch and the base branch.
6262
#
63-
# By default, this is disabled (set to nil). Valid values range from
63+
# By default, this is disabled (set to null). Valid values range from
6464
# -100.0 to +100.0.
6565
#
6666
# Example:
6767
# If set to 0.5, an error will be reported if the feature branch has
6868
# less than 0.5% more coverage than the base.
6969
#
7070
# If set to -0.5, the check allows up to 0.5% less coverage than the base.
71-
threshold: nil
71+
threshold: null

pkg/testcoverage/config_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ func Test_ConfigFromFile(t *testing.T) {
213213
assert.NoError(t, err)
214214
assert.Equal(t, savedCfg, cfg)
215215
})
216+
217+
t.Run("example file", func(t *testing.T) {
218+
t.Parallel()
219+
220+
cfg := Config{}
221+
filename := "../../.testcoverage.example.yml"
222+
err := ConfigFromFile(&cfg, filename)
223+
assert.NoError(t, err)
224+
})
216225
}
217226

218227
func TestConfigYamlParse(t *testing.T) {

0 commit comments

Comments
 (0)