Probleme with ng test + angular material
See original GitHub issueWhat is the current behavior?
I get ping timeout durring “ng test” process when i have “./node_modules/@angular/material/prebuilt-themes/indigo-pink.css” in “angula.json”. “ng test” take a long time and restart test again and again
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
===>> "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
16 01 2019 16:13:25.393:WARN [karma]: No captured browser, open http://localhost:9876/
16 01 2019 16:13:25.397:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
16 01 2019 16:13:25.397:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
16 01 2019 16:13:25.403:INFO [launcher]: Starting browser Chrome
16 01 2019 16:13:29.490:WARN [karma]: No captured browser, open http://localhost:9876/
16 01 2019 16:13:29.796:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket I5P0dN9-OxH5L8HlAAAA with id 79106811
16 01 2019 16:13:59.792:WARN [Chrome 71.0.3578 (Windows 8.1.0.0)]: Disconnected (0 times)Client disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
16 01 2019 16:14:09.108:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket ZCL4b9zrSmv5o8wBAAAB with id 79106811
16 01 2019 16:14:39.514:WARN [Chrome 71.0.3578 (Windows 8.1.0.0)]: Disconnected (0 times)Client disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
16 01 2019 16:14:43.492:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket QIDXrml-0m6LD-XDAAAC with id 79106811
Chrome 71.0.3578 (Windows 8.1.0.0): Executed 3 of 3 SUCCESS (0.001 secs / 0.095 secs)
TOTAL: 3 SUCCESS
TOTAL: 3 SUCCESS
16 01 2019 16:15:13.494:WARN [Chrome 71.0.3578 (Windows 8.1.0.0)]: Disconnected (0 times)Client disconnected from CChrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0): Executed 3 of 3 SUCCESS (0.001 secs / 0.095 secs)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
16 01 2019 16:15:21.831:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket e4GcYy059OB1BXhYAAAD with id 79106811
16 01 2019 16:15:52.235:WARN [Chrome 71.0.3578 (Windows 8.1.0.0)]: Disconnected (0 times)Client disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
16 01 2019 16:15:55.123:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket tTr75wwZ5xW8nPtBAAAE with id 79106811
Chrome 71.0.3578 (Windows 8.1.0.0): Executed 3 of 3 SUCCESS (0 secs / 0.096 secs)
TOTAL: 3 SUCCESS
TOTAL: 3 SUCCESS
16 01 2019 16:16:25.126:WARN [Chrome 71.0.3578 (Windows 8.1.0.0)]: Disconnected (0 times)Client disconnected from CChrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
Chrome 71.0.3578 (Windows 8.1.0.0): Executed 3 of 3 SUCCESS (0 secs / 0.096 secs)
Chrome 71.0.3578 (Windows 8.1.0.0) ERROR
DisconnectedClient disconnected from CONNECTED state (ping timeout)
16 01 2019 16:16:32.217:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket O3yulY6aUidXSWldAAAF with id 79106811
What are the steps to reproduce?
i can reproduce this by create an app with angular cli :
ng new app --routing
ng add @angular/material
ng test
When i remove the css include in angular.json :
ng test
16 01 2019 16:12:55.729:WARN [karma]: No captured browser, open http://localhost:9876/
16 01 2019 16:12:55.733:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
16 01 2019 16:12:55.734:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
16 01 2019 16:12:55.739:INFO [launcher]: Starting browser Chrome
16 01 2019 16:12:59.513:WARN [karma]: No captured browser, open http://localhost:9876/
16 01 2019 16:12:59.903:INFO [Chrome 71.0.3578 (Windows 8.1.0.0)]: Connected on socket N2lZLZYt4pJH7lMAAAAA with id 67449294
Chrome 71.0.3578 (Windows 8.1.0.0): Executed 3 of 3 SUCCESS (0.103 secs / 0.162 secs)
TOTAL: 3 SUCCESS
TOTAL: 3 SUCCESS
–
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I’m on Windows 8.1 and there is my package.json, i’m not sure to give you the right answer :
"dependencies": {
"@angular/animations": "~7.1.0",
"@angular/cdk": "~7.2.1",
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/material": "^7.2.1",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular/cli": "~7.1.4",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ng test throws error on angular material components
I'm getting multiple failures when I run ng test in my Angualr 8 project on angular material components. I haven't written any specific...
Read more >Testing with component harnesses - Angular Material
This guide discusses the advantages of using component test harnesses and shows how to use them.
Read more >How I found a problem with Angular unit testing and decided ...
I had to run “ng test” to run tests in the project, see the output in the console or open a browser and...
Read more >Why you shouldn't (over)use NO_ERRORS_SCHEMA in ...
It may be that NO_ERRORS_SCHEMA is okay for mocking some of your 3rd-party dependencies, like Angular Material? But you'll need to make that...
Read more >Angular unit testing tutorial with examples - LogRocket Blog
When you create a new project with the Angular CLI ( ng new appName ), a default component and test file are added....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi
I am getting the exact same issue after upgrading an application from angular 6 to 7 and, as per the simple recreation steps mentioned, find the same problem with a new application after adding angular material. Again, the problem can be worked around by removing the material style from the test node in angular.json
Is there a resolution in the pipeline for this?
Thanks
John
I am running Windows 10 and Chrome 72
06 02 2019 12:13:46.380:INFO [Chrome 72.0.3626 (Windows 10.0.0)]: Connected on socket 5xACUK1jskGAkaXSAAAA with id 17497926 06 02 2019 12:14:16.384:WARN [Chrome 72.0.3626 (Windows 10.0.0)]: Disconnected (0 times), because no message in 30000 ms. Chrome 72.0.3626 (Windows 10.0.0) ERROR Disconnected, because no message in 30000 ms.
Chrome 72.0.3626 (Windows 10.0.0) ERROR Disconnected, because no message in 30000 ms.
06 02 2019 12:14:18.393:WARN [launcher]: Chrome was not killed in 2000 ms, sending SIGKILL. 06 02 2019 12:14:20.394:WARN [launcher]: Chrome was not killed by SIGKILL in 2000 ms, continuing.
If --watch=true, Chrome also periodically displays a ‘Page Unresponsive’ dialog.
Package versions as follows:
“dependencies”: { “@angular/animations”: “~7.2.0”, “@angular/cdk”: “~7.3.1”, “@angular/common”: “~7.2.0”, “@angular/compiler”: “~7.2.0”, “@angular/core”: “~7.2.0”, “@angular/forms”: “~7.2.0”, “@angular/material”: “^7.3.1”, “@angular/platform-browser”: “~7.2.0”, “@angular/platform-browser-dynamic”: “~7.2.0”, “@angular/router”: “~7.2.0”, “core-js”: “^2.5.4”, “hammerjs”: “^2.0.8”, “rxjs”: “~6.3.3”, “tslib”: “^1.9.0”, “zone.js”: “~0.8.26” }, “devDependencies”: { “@angular-devkit/build-angular”: “~0.13.0”, “@angular/cli”: “~7.3.0”, “@angular/compiler-cli”: “~7.2.0”, “@angular/language-service”: “~7.2.0”, “@types/node”: “~8.9.4”, “@types/jasmine”: “~2.8.8”, “@types/jasminewd2”: “~2.0.3”, “codelyzer”: “~4.5.0”, “jasmine-core”: “~2.99.1”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “~3.1.1”, “karma-chrome-launcher”: “~2.2.0”, “karma-coverage-istanbul-reporter”: “~2.0.1”, “karma-jasmine”: “~1.1.2”, “karma-jasmine-html-reporter”: “^0.2.2”, “protractor”: “~5.4.0”, “ts-node”: “~7.0.0”, “tslint”: “~5.11.0”, “typescript”: “~3.2.2” }
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.