Skip to content

Commit d5a3723

Browse files
committed
Fix test so it looks through all log lines
1 parent 88ad6cc commit d5a3723

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/cmd/tests/cmd_run_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,15 @@ func TestBrowserPermissions(t *testing.T) {
24592459
cmd.ExecuteWithGlobalState(ts.GlobalState)
24602460
loglines := ts.LoggerHook.Drain()
24612461

2462-
assert.Contains(t, loglines[0].Message, tt.expectedError)
2462+
var found bool
2463+
for _, logline := range loglines {
2464+
if strings.Contains(logline.Message, tt.expectedError) {
2465+
found = true
2466+
break
2467+
}
2468+
}
2469+
2470+
assert.True(t, found, "expected error %q not found in loglines", tt.expectedError)
24632471
})
24642472
}
24652473
}

0 commit comments

Comments
 (0)