How to set up the new Resolver in Tests

I’m switching to using the ember-resolver npm package now in 2.2 and it’s broken my tests. Can anyone point me to a working example of how to configure the ember app and the resolver for testing using the new package?

I’m trying to avoid using the deprecated bower package.

Are you sure that works with ember 2.2 ? I have a similar resolver.js … the tests run fine in the browser, but running ember test gets me an error:

                at http://localhost:7357/assets/test-loader.js:40
                at http://localhost:7357/assets/test-support.js:6081: Could not find module `ember-resolver` imported fro```

Make sure you add the npm module to your package.json (assuming you also removed the bower version of the resolver).

Hi, I’ve been getting this same issue for quite a while now and nothing can fix it.

Tests run fine with “ember test --launch=chromium”, however I get the same error as above (Could not find module ember-resolver) when I run just “ember test” (and they run with PhantomJS, not in a browser). Yes, I’ve put “ember-resolver”: “2.0.3” in package.json and I’ve removed “ember-resolver” from bower.json.

Any ideas?

So the problem was actually in PhantomJS’s lack of support for ES6. We were importing some 3rd party modules which use ES6 stuff and it was blowing up because of that. If you app.import “es6-shim” in your “ember-cli-build.js” file it should fix the issue.