Promise rejected before it renders: _emberCliMirage.default.initialize is not a function

Hi Friends,

I am stuck how to set Promise in integration test case with ember js .

Please let us me.

Regards, Maroti

Please help me to how to set Promise with ember js application when we create integration test.

Mirage is not automatically initialized for integration tests, see the documentation for manually starting mirage here

Hi dknutsen,

Thanks for your quick response.

But I have follow this set still I am getting error. I have share with you screen shot for the same.

Error :- ‘Promise rejected before it renders: _emberCliMirage.default.initialize is not a function’

From the error message it seems like you are importing the default export then calling initialize on it:

import Initializer from 'yourapp/initializers/ember-cli-mirage';

Initializer.initialize();

As mentioned by @dknutsen, the docs state that you need to import a named export:

import { startMirage } from 'yourapp/initializers/ember-cli-mirage';

Ultimately, this could be caused by other errors too. E.g. something else is throwing an error while your assets are loading which would cause some modules to end up missing…

Hi rwjblue,

Thanks for your help. I have importing the default export then calling initialize still I am getting error that is build error. I have share with you screenshot for the same.

Thanks for help.

Thanks, Maroti