pactumjs / pactum

REST API Testing Tool for all levels in a Test Pyramid
https://pactumjs.github.io
MIT License
545 stars 52 forks source link

feat: capture cookies with res.cookies and req.cookies in stores and returns #288

Closed baabouj closed 1 year ago

baabouj commented 1 year ago

closes #174.

In addition, you can now add cookies to the interaction request and response:

mock.addInteraction({
  request: {
    method: 'GET',
    path: '/api/hello',
    cookies: {
      lang: 'en',
    }
  },
  response: {
    status: 200,
    body: 'Hello, 👋',
    cookies: {
      token: 'xyz',
    }
  }
});