What should I use instead of DS.FixtureAdapter
You must love the ember.js team ... I am getting this depreciation message: "DS.FixtureAdapter is deprecated and moved to an unsupported addon: https://github.com/emberjs/ember-data-fixture-adapter/tree/master " ... Guys, supporting this addon, we advise us to use a library similar to Pretender
. Has anyone done this? Is there a tutorial showing how to integrate this library to keep things still working?
source to share
If you are using it ember-cli
, it comes out http-mock
of the box, allowing you to quickly set up your fixtures in a more realistic test scenario. For example, for a model, Conversation
you can mock her by running the following prompt at the command line.
ember g http-mock conversations
This will close the endpoint located at server/mocks/conversations.js
which your real adapters will use to get data on startup ember serve
. You can modify this file to your liking to return any data you need for various CRUD operations.
source to share
Server mocks:
Clientside mocks:
- Pretender.js
- jQuery mockjax
- Ember CLI Mirage , mostly sugar around the Challenger
Clientside mocking has some benefits, such as portability, which makes it easier to use in a CI environment, but server-side mocking allows you to take advantage of middleware.
Note. I support Mirage. You can watch the screencast and review here .
source to share
I like to use http-mocks with ember-cli. Also, I like to use raw JSON files as the payload for each endpoint here is a setup example https://github.com/pixelhandler/ember-fixturific/pull/1/files
source to share