Skip to content

Commit 6978869

Browse files
committed
tests: coverage: output file
1 parent 23cc0c3 commit 6978869

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cmd/root_test.go

+21
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ func Test_validate(t *testing.T) {
8888
}
8989
},
9090
},
91+
{
92+
name: "Successful validation output file",
93+
args: args{
94+
config: formatter.Config{
95+
OutputFormat: formatter.ExcelOutput,
96+
InputFileConfig: formatter.InputFileConfig{
97+
Path: path.Join(os.TempDir(), "formatter_cmd_valid_output"),
98+
},
99+
OutputFile: formatter.OutputFile("output.xlsx"),
100+
},
101+
},
102+
wantErr: false,
103+
before: func(t *testing.T) {
104+
path := path.Join(os.TempDir(), "formatter_cmd_valid_output")
105+
_, err := os.Create(path)
106+
if err != nil {
107+
t.Errorf("could not create input file: %s", path)
108+
}
109+
},
110+
after: func(t *testing.T) {},
111+
},
91112
{
92113
name: "Successful validation template",
93114
args: args{

0 commit comments

Comments
 (0)