Files
bruno/packages/bruno-tests/collection/scripting/api/res/setBody/string.bru

34 lines
395 B
Plaintext

meta {
name: string
type: http
seq: 4
}
post {
url: {{host}}/api/echo/json
body: json
auth: none
}
body:json {
{
"hello": "bruno"
}
}
assert {
res.status: eq 200
}
script:post-response {
res.setBody("hello from post-res")
}
tests {
test("res.setBody(string)", function() {
const body = res.getBody();
expect(body).to.eql("hello from post-res");
});
}