Skip to content

ng test fails when using @angular2-material #420

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

Closed
altrim opened this issue Apr 11, 2016 · 2 comments
Closed

ng test fails when using @angular2-material #420

altrim opened this issue Apr 11, 2016 · 2 comments

Comments

@altrim
Copy link

altrim commented Apr 11, 2016

Running

ng test

I get the following output

11 04 2016 17:58:27.022:INFO [Chrome 49.0.2623 (Mac OS X 10.11.4)]: Connected on socket /#AH3vJpgKGh8vKV7OAAAA with id 62538159
11 04 2016 17:58:27.938:WARN [web-server]: 404: /base/dist/@angular2-material/button/button
11 04 2016 17:58:27.939:WARN [web-server]: 404: /base/dist/@angular2-material/checkbox/checkbox
11 04 2016 17:58:27.941:WARN [web-server]: 404: /base/dist/@angular2-material/core/annotations/field-value
11 04 2016 17:58:27.944:WARN [web-server]: 404: /base/dist/@angular2-material/core/live-announcer/live-announcer
11 04 2016 17:58:27.959:WARN [web-server]: 404: /base/dist/@angular2-material/core/portal/portal-directives
11 04 2016 17:58:27.960:WARN [web-server]: 404: /base/dist/@angular2-material/core/portal/portal
11 04 2016 17:58:27.965:WARN [web-server]: 404: /base/dist/@angular2-material/core/overlay/overlay
11 04 2016 17:58:27.966:WARN [web-server]: 404: /base/dist/@angular2-material/core/overlay/overlay-state
11 04 2016 17:58:27.981:WARN [web-server]: 404: /base/dist/@angular2-material/core/overlay/position/global-position-strategy
11 04 2016 17:58:27.990:WARN [web-server]: 404: /base/dist/@angular2-material/core/portal/dom-portal-host
11 04 2016 17:58:27.992:WARN [web-server]: 404: /base/dist/@angular2-material/input/input
11 04 2016 17:58:27.994:WARN [web-server]: 404: /base/dist/@angular2-material/list/list
11 04 2016 17:58:27.998:WARN [web-server]: 404: /base/dist/@angular2-material/toolbar/toolbar
11 04 2016 17:58:28.001:WARN [web-server]: 404: /base/dist/@angular2-material/progress-circle/progress-circle
Chrome 49.0.2623 (Mac OS X 10.11.4) ERROR
  Error: XHR error (404 Not Found) loading /Users/altrimbeqiri/Developer/angular2-material/dist/@angular2-material/button/button
      at error (/Users/altrimbeqiri/Developer/angular2-material/node_modules/systemjs/dist/system.src.js:1026:16)
      at XMLHttpRequest.xhr.onreadystatechange (/Users/altrimbeqiri/Developer/angular2-material/node_modules/systemjs/dist/system.src.js:1047:13)
      at XMLHttpRequest.wrapFn [as _onreadystatechange] (/Users/altrimbeqiri/Developer/angular2-material/node_modules/angular2/bundles/angular2-polyfills.js:771:30)
      at ZoneDelegate.invokeTask (/Users/altrimbeqiri/Developer/angular2-material/node_modules/angular2/bundles/angular2-polyfills.js:365:38)
      at Zone.runTask (/Users/altrimbeqiri/Developer/angular2-material/node_modules/angular2/bundles/angular2-polyfills.js:263:48)
      at XMLHttpRequest.ZoneTask.invoke (/Users/altrimbeqiri/Developer/angular2-material/node_modules/angular2/bundles/angular2-polyfills.js:431:34)

11 04 2016 17:58:28.024:WARN [web-server]: 404: /@angular2-material/card
11 04 2016 17:58:28.027:WARN [web-server]: 404: /@angular2-material/button
11 04 2016 17:58:28.027:WARN [web-server]: 404: /@angular2-material/input
11 04 2016 17:58:28.027:WARN [web-server]: 404: /@angular2-material/progress-circle
11 04 2016 17:58:28.028:WARN [web-server]: 404: /@angular2-material/list

Tried to add the folder @angular2-material in karma.conf.js proxies but it didn't help still getting same error.

 proxies: {
      // required for component assets fetched by Angular's compiler
      '/app/': '/base/dist/app/',
      '/@angular2-material/': '/base/dist/@angular2-material/'
    },

Am I missing something, do I need to install/add additional stuff?

I created this repository https://github.com/altrim/angular2-material so you can check the issue.


Mac OSX - El Capitan

angular-cli: 0.0.30
node: 5.10.1
npm 3.8.6

@hansl
Copy link
Contributor

hansl commented Apr 13, 2016

So Karma uses its own System.config. You need to set it separately in karma-test-shim.js.

We are working on a solution to replace both configs by a single one, which will simplify things up. You can follow this up in #429. I'm going to close this.

If you need help configuring System in karma-test-shim.js, please let us know. We're on gitter :)

Cheers

@hansl hansl closed this as completed Apr 13, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants