ember.js - Using Pretender in an ember-cli app with a custom hostname -
i extend ds.activemodeladapter use custom host since api on subdomain, using, example, http://api.lvh.me:3000 when working locally.
in tests try use pretender mock responses api requests, pretender isn't handling requests, suspect due custom host setting.
i've tried many different variations make work, including setting host different values, not setting host @ all, running tests --proxy command, , on.
i'm throwing darts @ wall , hoping stick. can guide me understanding should doing?
it might work if define host of adapter config variable:
export default ds.activemodeladapter.extend({ host: config.apihost }); you define host "real" host in non-hosting environments (http://api.lvh.me:3000) , omit config.apihost in testing. if so, can use pretender stub out requests since same-host (or, in other words, relative) requests.
Comments
Post a Comment