Closed kh-nguyen-le closed 2 years ago
Ok, I forced @angular/cdk to update and it resolved the error traces. But the problem of not loading the tests still remains.
Made some progress. I investigated further and found that I had 2 global angular-cli installs in /usr/local/lib/node_modules/ and /usr/lib/node_modules/ like @markusgraube described in #53 since I had install angular long before I installed n. However the issue is still not resolved. I uninstalled angular from both directories (one at a time) but the extension still infinitely reloads until I run ng test manually, then they show up.
Hi @kh-nguyen-le , we just released v1.2.8. Once you've upgraded to that version (should happen automatically in VS Code), please try again and check the output window for the test logs. This new version has some additional error handling that may show you what the issue is. It also shows the command used to launch the karma process (ng test
for example), which may provide additional insight into what's going wrong here.
I am on 1.2.7 and don't have the option to upgrade to 1.2.8. Also I changed my project to use Jest so I'll have to checkout an older version to test it.
Sorry that's my bad, 1.2.8 is not yet released, working on that now.
v1.2.8 is released, let me know if the enhanced logging messages help you solve your issue. Often times the issue is that the extension is not launching karma correctly for your config.
v1.2.8 is released, let me know if the enhanced logging messages help you solve your issue. Often times the issue is that the extension is not launching karma correctly for your config.
Hi @s4m0r4m4, I have v1.2.8 installed and still have the same issue as descibed
@KChap33 are you seeing any errors/output in the VS Code Extension output window?
@KChap33 are you seeing any errors/output in the VS Code Extension output window?
Hi @s4m0r4m4 , no, there is no output in the extensions output window.
Ok try this - enable debug mode in settings if you have not already (search for "debug" in VS Code settings and then navigate to "Angular/Karma Test explorer"). Restart VS Code just to be safe. Then check the output of both "Test Explorer" and "Test Explorer Logs". If nothing shows up there, then try Help -> Toggle Developer Tools and see if there are any errors in that console.
I am having a similar problem to this, where it can only find SOME of the unit tests, but not all of them. I keep having to retire/reset the tests and reload to get more tests to show up, but there seems to be an issue detecting all the tests. Note that our project structure includes components within components within components, so maybe the layering is throwing it off? Not sure, but wanted to tag this issue as important as debugging angular karma tests is pretty clutch and right now, our team is in "console.log" hell trying to work around this because we can't just debug currently.
When I look at the Test Explorer Logs, I see this show up before it gives up finding tests:
Going forward we suggest using https://github.com/lucono/karma-test-explorer
We are planning on deprecating this extension in favor of using that one, as it has more active support.
Describe the bug The extension cannot find my Angular tests and infinitely spins the reload icon. I know this issue gets posted a lot but I've read all of the other posts about it and cannot find a solution.
To Reproduce https://github.com/kh-nguyen-le/rails-ng-demo
Logs [6:30:22 PM] INFO: Starting Angular test enviroment for project: frontend [6:30:23 PM] INFO: Listening to AngularReporter events on port 9999 [6:31:39 PM] ERROR: stderr: ERROR in ./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js Module not found: Error: Can't resolve 'core-js/proposals/reflect-metadata' in '/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models' resolve 'core-js/proposals/reflect-metadata' in '/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models' Parsed request is a module using description file: /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/package.json (relative path: ./src/angular-cli-files/models) Field 'browser' doesn't contain a valid alias configuration resolve as module looking for modules in /mnt/c/repos/rails-ng-demo/client using description file: /mnt/c/repos/rails-ng-demo/client/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration using description file: /mnt/c/repos/rails-ng-demo/client/package.json (relative path: ./core-js/proposals/reflect-metadata) no extension Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.ts doesn't exist .tsx Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.tsx doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.js doesn't exist as directory /mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata doesn't exist /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/client/node_modules/node_modules doesn't exist or is not a directory /mnt/c/repos/rails-ng-demo/node_modules doesn't exist or is not a directory /mnt/c/repos/node_modules doesn't exist or is not a directory /mnt/c/node_modules doesn't exist or is not a directory /mnt/node_modules doesn't exist or is not a directory /node_modules doesn't exist or is not a directory looking for modules in /mnt/c/repos/rails-ng-demo/client/node_modules using description file: /mnt/c/repos/rails-ng-demo/client/package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration using description file: /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/package.json (relative path: ./proposals/reflect-metadata) no extension Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.ts doesn't exist .tsx Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.tsx doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.js doesn't exist as directory /mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata doesn't exist [/mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata] [/mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.ts] [/mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.tsx] [/mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.mjs] [/mnt/c/repos/rails-ng-demo/client/core-js/proposals/reflect-metadata.js] [/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/angular-cli-files/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/src/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/build-angular/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/@angular-devkit/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/node_modules] [/mnt/c/repos/rails-ng-demo/node_modules] [/mnt/c/repos/node_modules] [/mnt/c/node_modules] [/mnt/node_modules] [/node_modules] [/mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect [6:31:39 PM] ERROR: stderr: -metadata] [/mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.ts] [/mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.tsx] [/mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.mjs] [/mnt/c/repos/rails-ng-demo/client/node_modules/core-js/proposals/reflect-metadata.js] @ ./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js 8:0-44 @ multi ./src/polyfills.ts ./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js
Screenshots
Desktop (please complete the following information):
Additional context My app uses Rails for the backend at the root and uses Angular for the frontend at ./client I have configured the settings as shown in the above screenshot. The ruby test explorer extension is working for my app and disabling it does not resolve the issue.