Skip to content
On this page

Empower Your Test Results with AI-Powered Insights ->

setDefaultExpectResponseTime

set default expect response time (ms) for all the response assertions.

Syntax

js
setDefaultExpectResponseTime(timeInMs)
  • timeInMs (number) - response time value in milliseconds

Usage

โœ… Correct Usage

js
response.setDefaultExpectResponseTime(2000)

Examples

Normal

js
const { spec, response } = require('pactum');

response.setDefaultExpectResponseTime(2000)

await spec()
  .get('https://randomuser.me/api')
  .expectStatus(200);

See Also

Released under the MIT License.