http-mocks currently are not hooked up on the express server that is instantiated as part of ember test
.
There have been a number of attempts to land this and those can be tracked here: ember-cli/issues/#1763
Until the core issue is fixed, this addon works around the feature/bug by allowing mocks to be registered against the testem server.
ember install ember-cli-testem-http-mocks
ember g http-mock /api
(create a mock if one is not already created)
DISABLE_MOCKS=true ember test
ember server
- Visit your app at http://localhost:4200.
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://ember-cli.com/.