-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocks: andSucceed/andFail everywhere #157
Comments
I am thinking of renaming to just succeeds() and fails() |
Good idea. BTW, I started working on this and it was kind of a rabbit hole, as, for example, Do you have an idea about how to make the transition smoother? I'd guess that returning a And happy new year! :) |
Neato that you started on this. :) And good point there about handleFind. One idea would be to move this id functionality from: var id = FactoryGuy.get('fixtureBuilder').extractId(modelName, json);
var url = this.buildURL(modelName, id);
new MockGetRequest(url, modelName, json);
return id; to something like a property on MockGetRequest var mockRequest = new MockGetRequest(url, modelName, json);
mockRequest.id = FactoryGuy.get('fixtureBuilder').extractId(modelName, json);
return mockRequest; for handleReload would be similar, although redundant or not even necessary I suppose. .. I am open to anything else really. And same here .. happy new year! |
are there things you're still stuck on. I am dedicating tomorrow to work on this and finish these issues, so let me know which you have not done, or which you want help on? |
@xcambar .. thanks for the amazing ideas that got me going on the huge refactor. I looked at your commits and used them as a base for my changes. you can now do this: let mock = mockFind('user');
let userId = mock.get('id'); I also added ability to inspect json with get method ( huge improvement ) thanks again! |
Add
andSuccess
andaddFail
public methods to all mock classes so the user can test more use cases (500, 404...)refs #156 (comment)
The text was updated successfully, but these errors were encountered: