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

40 lines
475 B
Plaintext
Raw Normal View History

meta {
name: getResponseTime
type: http
seq: 5
}
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.getResponseTime()", function() {
const responseTime = res.getResponseTime();
expect(typeof responseTime).to.eql("number");
expect(responseTime > 0).to.be.true;
});
}