bruno/packages/bruno-tests/collection/scripting/api/res/getBody.bru

41 lines
409 B
Plaintext
Raw Normal View History

meta {
name: getBody
type: http
seq: 4
}
post {
url: {{host}}/api/echo/json
body: json
auth: none
}
auth:basic {
username: asd
password: j
}
auth:bearer {
token:
}
body:json {
{
"hello": "bruno"
}
}
assert {
res.status: eq 200
}
tests {
test("res.getBody()", function() {
const data = res.getBody();
expect(data).to.eql({
"hello": "bruno"
});
});
}