Skip to content

Commit 7909b55

Browse files
committed
fixup! feat: improve missing formatter test
Signed-off-by: Brian McGee <[email protected]>
1 parent 9d521a9 commit 7909b55

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

cmd/root_test.go

+17-14
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,25 @@ func TestAllowMissingFormatter(t *testing.T) {
156156
},
157157
})
158158

159-
// default
160-
treefmt2(t,
161-
withError(func(err error) {
162-
as.ErrorIs(err, format.ErrCommandNotFound)
163-
}),
164-
)
159+
t.Run("default", func(t *testing.T) {
160+
treefmt2(t,
161+
withError(func(err error) {
162+
as.ErrorIs(err, format.ErrCommandNotFound)
163+
}),
164+
)
165+
})
165166

166-
// arg
167-
treefmt2(t,
168-
withArgs("--allow-missing-formatter"),
169-
withNoError(as),
170-
)
167+
t.Run("arg", func(t *testing.T) {
168+
treefmt2(t,
169+
withArgs("--allow-missing-formatter"),
170+
withNoError(as),
171+
)
172+
})
171173

172-
// env
173-
t.Setenv("TREEFMT_ALLOW_MISSING_FORMATTER", "true")
174-
treefmt2(t, withNoError(as))
174+
t.Run("env", func(t *testing.T) {
175+
t.Setenv("TREEFMT_ALLOW_MISSING_FORMATTER", "true")
176+
treefmt2(t, withNoError(as))
177+
})
175178
}
176179

177180
func TestSpecifyingFormatters(t *testing.T) {

0 commit comments

Comments
 (0)