Skip to content

Commit 86062c2

Browse files
authored
Fix/test empty image check (#3087)
* test(run): add check for empty image in TestRun_CorrectImage * typo
1 parent 8c4002c commit 86062c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/run_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ func TestRun_CorrectImage(t *testing.T) {
334334
runner := mock.NewRunner()
335335

336336
runner.RunFn = func(_ context.Context, f fn.Function, _ string, _ time.Duration) (*fn.Job, error) {
337-
// TODO: add if for empty image? -- should fail beforehand
337+
if f.Build.Image == "" {
338+
return nil, fmt.Errorf("Image is empty, should fail before running")
339+
}
338340
if f.Build.Image != tt.image {
339341
return nil, fmt.Errorf("Expected image: %v but got: %v", tt.image, f.Build.Image)
340342
}

0 commit comments

Comments
 (0)