How to set up the new Resolver in Tests


#1

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.


#2

https://github.com/aptible/dashboard.aptible.com/pull/423


#3

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```

#4

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


#5

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?


#6

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.