atecarlos / protractor-http-mock

A library designed to work alongside Protractor for setting up mocks for your HTTP ajax requests.
MIT License
173 stars 70 forks source link

Ability to have multiple JSON objects in mock files #3

Closed nadersoliman closed 9 years ago

nadersoliman commented 10 years ago

Currently we need one json file for every mock object. It would be great if we can also support loading multiple mock objects from a single file in some like

[ {
 request: {}
 response: {}
},
 request: {}
 response: {}
}]

The reason is that we sometime have multiple mocks we need to load in together to support a single test case and they don't mean much if they are alone.

atecarlos commented 10 years ago

In some earlier version, I started down that path, but I went for the simpler approach to make it more explicit. I'll look into it though, and see how the code turns out with both options. Thanks for the suggestion.

atecarlos commented 9 years ago

I added the code do to this in the latest release. Please let me know how it goes for you. Thanks!