adopted-ember-addons / ember-data-factory-guy

Factories and helper functions for (unit, integration, acceptance) testing + development scenarios with Ember Data
MIT License
301 stars 136 forks source link

allow match() to be used for any mock request #452

Open dwickern opened 2 years ago

dwickern commented 2 years ago

Currently only mockCreate and mockUpdate support match(). This PR adds match() for the other kinds of mock requests. Request bodies can get complex so it's nice to have a callback where you can do assertions etc.

For the implementation I basically merged AttributeMatcher into MockRequest.

patocallaghan commented 2 years ago

Thanks for working on this @dwickern. I've just kicked off CI to run the tests.

Any chance we could add some updates to the existing README which outlines how you'd use this?