Skip to content
On this page

Empower Your Test Results with AI-Powered Insights ->

removeInteraction

Remove interactions from the mock server.

Syntax

js
removeInteraction(id)

Usage

โœ… Correct Usage

js
mock.removeInteraction('id');
js
// using multiple interaction ids
mock.removeInteraction(['id1', 'id2']);

Arguments

> id (string|string[])

Interaction ids

Examples

Normal

js
const { mock } = require('pactum');

const id = mock.addInteraction({
  request: {
    method: 'GET',
    path: '/api/hello'
  },
  response: {
    status: 200,
    body: 'Hello, ๐Ÿ‘‹'
  }
});

mock.removeInteraction(id);

Released under the MIT License.