-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import components in unit tests #124
Comments
I had the same problem, if you add var domAdapter = require('angular2/src/core/dom/browser_adapter').BrowserDomAdapter;
domAdapter.makeCurrent(); to the spec.bundle.js after the requires, seems to solve it for me. |
FYI in the test seed this is done in the karma-test-shim.js file - https://github.com/juliemr/ng2-test-seed/blob/master/karma-test-shim.js (line 32) https://github.com/juliemr/ng2-test-seed/blob/master/karma-test-shim.js |
@ao21 can you make a pull-request |
done via #128 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to import app.ts into unit tests, but I don't know how it should work. I used https://github.com/juliemr/ng2-test-seed to get tests working so my test file looks like this:
and my app.ts files:
In result I'm getting:
I also tried with
injectAsync
but have the same result.The text was updated successfully, but these errors were encountered: