Search code examples
ember.jsember-cli

Ember.cli acceptance tests Could not find module


I have been trying to figure out why my integration tests aren't working for a few days now. Here is the travis log:

https://travis-ci.org/allistera/mileager.io-front

The error is:

Could not find module ember-modal-dialog/initializers/add-modals-container imported from car-mileager-frontend/initializers/add-modals-container

The only reference to add-modals-container that I can find is in a third party package ember-cli-materialise.

I also mock my API using ember-mock.

Kind of new to ember so not sure what further debugging I can do. The source code for the project is:

http://github.com/allistera/mileager.io-front

When I run

$ ember test

From my command line I get the same error...

Thanks for any help!


Solution

  • As far as I know... (this is a follow-up from my comment above-- I ran into the same issue).

    The root cause of this issue is that PhantomJS 1.9.x doesn't support ES5, which is used in ember-cli-materialize (specifically, Function.prototype.bind). The symptom is that Ember acceptance tests will fail in Phantom, but pass in your browser, when running ember test --server. The solution is to upgrade your phantom binary to 2.0, or use the addon ember-cli-es5-shim in your Ember project.

    There is a PR open here: https://github.com/mike-north/ember-cli-materialize/pull/237 to add a note about this to the ember-cli-materialize README.

    For more background, check out the issue thread: https://github.com/ember-cli/ember-cli/issues/2634

    Hope that helps-- let me know if you happen to implement this solution, and if it fixes the problem.