GuidesAPI Reference
API Reference

get activeMocks

returns all active mocked requests object definitions.

import Mimic from 'mimic';

console.log(Mimic.activeMocks);

Output

[
  {
    "id": "5741faa6-f8c2-492e-8166-c3925d3bc20c",
    "active": true,
    "method": "GET",
    "url": "http://jsonplaceholder.typicode.com/posts/2",
    "headers": {
      "pragma": "no-cache",
      "content-type": "application/json; charset=utf-8",
      "cache-control": "public, max-age=14400",
      "expires": "Thu, 22 Sep 2016 11:49:01 GMT"
    },
    "response": {
      "delay": 152,
      "status": 200,
      "body": "{\n  \"userId\": 1,\n  \"id\": 2,\n  \"title\": \"qui est esse\",\n  \"body\": \"est rerum tempore vitae\\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\\nqui aperiam non debitis possimus qui neque nisi nulla\"\n}"
    }
  }
]