yevhenpavliuk / ng-mock-e2e

Fake HTTP back end in Protractor end-to-end tests similarly to how it's done in AngularJS unit tests.
MIT License
15 stars 1 forks source link

Mock Depth limited by toSrc #3

Closed AlexStef closed 7 years ago

AlexStef commented 7 years ago

Hi, thank your for you work, but i encountered an issue with ng-mock-e2e

In the code you use toSrc inside a map function (here : https://github.com/yevhenpavliuk/ng-mock-e2e/blob/master/ng-mock-e2e.js#L191 ) but toSrc has a maximum depth for objects, by default set to 1.

If you dont pass a depth-parameter, it will default to 1. In this case all objects within an object or an array are converted to undefined.

Therefore when i mock some data, if the object has a depth of more than 1, some data will be undefined, like this :

$httpBackend.when('GET', '/myendpoint').respond({ levelOne: { levelTwo: 'value'}});

Do you have any ways not to lose the depths of my mocks ? Thanks in advance

pitpit commented 7 years ago

same issue here ! 👍

yevhenpavliuk commented 7 years ago

@AlexStef, thank you for reporting the issue! I'll look into it this weekend.

yevhenpavliuk commented 7 years ago

@AlexStef, @pitpit I've set the depth to the maximum possible value. Now the issue should be fixed in ng-mock-e2e@0.1.2.

AlexStef commented 7 years ago

@yevhenpavliuk It works ! Thanks a lot