Open Demianeen opened 5 months ago
we filter the headers to only show the ones being tested for
the behavior is kinda confusing, I will try to see if I can think of a way to make it more obvious 👍
Sure. As an idea, I think you can highlight the headers that are being tested
Would something like this make sense? We iterate through the result headers and use lipgloss to style any matches from the expected headers as green otherwise output them as grey. Then we can also loop through the expected headers and output any missing ones as red.
for k, v := range result.Headers {
if req.Request.Headers[k] == v {
fmt.Print(green.Render(fmt.Sprintf(" - %v: %v", k, v)) + "\n")
} else {
fmt.Printf(gray.Render(fmt.Sprintf(" - %v: %v", k, v)) + "\n")
}
}
for k, v := range req.Request.Headers {
if _, found := result.Headers[k]; !found {
fmt.Printf(red.Render(fmt.Sprintf(" - %v: %v", k, v)) + "\n")
}
}
@Waldeedle that looks nice!
I'm going to rewrite the render functions for the HTTP tests soon to match the fancy ones we have for the commands now, I'll keep this idea in mind
When I run bootdev cli I don't see headers. For example for routing lesson:
I can see headers in any other rest clients. Also, the lesson submission does work.