2

I have added ng-apimock to our Angular project. I already have a mock definition like this:

 {
  "expression": "MyServiceEndpoint",
  "method": "GET",
  "name": "Edit",
  "isArray": false,
  "responses": {
    "default": {
      "default": true,
      "status": 200,
      "headers": {},
      "data": {
        "id": 3,
        "text": "some text"
      }
    }
  }
}

I am reading documentation https://github.com/mdasberg/ng-apimock. But i cannot understand how to use use written mocks.Where to connect the mocks file?

ts-alan
  • 99
  • 1
  • 6

1 Answers1

0

You can refer to my answer to this question -

Mocking and Stubbing with protractor

Here, I've explained all the configuration that I needed to do in detail. After configuring a mock server, you can use the API in the e2e test cases. Have given example usages in the linked answer.

Prakhar
  • 25
  • 1
  • 7