Comments (12)
Thanks so much for the pointers. My problem was slightly different, but understanding what the extension was looking for from the target helped put me on the right track.
from angular-karma_test-explorer.
I am experiencing this issue also. tests run fine with ng test but do not show up in explorer and loading icon is permanently spinning. No output in terminal or extension log
from angular-karma_test-explorer.
Hi, same problem for me too. Is there a workaround ?
from angular-karma_test-explorer.
I have not found a workaround for this yet
from angular-karma_test-explorer.
As a temporary solution I use jest with Jest Test Explorer plugin and it works. I just had to modify my test launch configuration to be compatible.
from angular-karma_test-explorer.
@mbrechet What did you modify in the configuration?
from angular-karma_test-explorer.
Hi, I follow @ahasall tutorial to replace Karma by Jest and install Jest Test Explorer plugin :
https://www.amadousall.com/how-to-set-up-angular-unit-testing-with-jest//
I works for me with Angular 11
The files in the .vscode folder are only useful if you want to debug directly in vscode during your tests. I thnink, the plugin problem occurs before because we cannot run the tests.
from angular-karma_test-explorer.
I've run into this as well. For me the issue was this:
- This extension assumes the target to launch from the selected project is called "test" and that it has a "karmaConfig" option specified.
- I had a Jest-based target called "test", which was being launched by the extension (it does not check to see if it is truly a karma-based test)
- The extension does not have a timeout when waiting to connect to the karma test, so it just sits there indefinitely.
Make sure your default project (or the selected project, whichever you're using) has a target called "test" that launches your karma tests.
from angular-karma_test-explorer.
I've run into this as well. For me the issue was this:
- This extension assumes the target to launch from the selected project is called "test" and that it has a "karmaConfig" option specified.
- I had a Jest-based target called "test", which was being launched by the extension (it does not check to see if it is truly a karma-based test)
- The extension does not have a timeout when waiting to connect to the karma test, so it just sits there indefinitely.
Make sure your default project (or the selected project, whichever you're using) has a target called "test" that launches your karma tests.
What are you referring to when you say "target"? Do you mean a command or entry point?
from angular-karma_test-explorer.
In Angular parlance, targets are specific configurations that govern how the Angular CLI functions. So ng build
is calling the build
target of the Angular CLI. In a more practical sense - in the angular.json file, the targets are the keys within the architect
object within a given project. So in the example below, build
, serve
, test-jest
, and test
are all targets for the angular project my-project
.
"projects": {
"my-project": {
...
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
...
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
...
},
"test-jest": {
},
"test": {
....
You can read more here: https://angular.io/guide/workspace-config#default-architect-builders-and-targets
from angular-karma_test-explorer.
from angular-karma_test-explorer.
Glad to hear it. I've submitted a PR to help provide a little more visibility to when tests don't appear, but there's certainly more work to be done. What was your fix? Hopefully we can document more of these to help others too. If you have things working, you can close this issue too.
from angular-karma_test-explorer.
Related Issues (20)
- Extension issue HOT 8
- stderr: Install for [ '@angular/cli@latest' ] failed with code 1
- Make Angular/Karma Test Explorer work with test frameworks other than Jasmine HOT 1
- Nesting describe-elements issue
- Support for Karma version 6 HOT 8
- stderr: 'ng' is not recognized as an internal or external command HOT 1
- Can't debug Angular 10 tests HOT 1
- Infinite Spinner: Cypress Screenshots directories trip up the reporter
- Debug throw error about Cannot connect to the target at localhost HOT 2
- Update Extension to indicate Status HOT 1
- Code coverage report(s) HOT 2
- Infinitely searching for tests HOT 12
- Debugger for Chrome extension is now retired (now vscode built-in extension) HOT 4
- Remote Development - Ability to customize extension's internal Karma browser configuration HOT 2
- Tests are discovered but Code Lens and Show Source buttons are not displayed HOT 9
- Ability to supply environment variables required for test execution HOT 1
- Discovered tests are from another project HOT 1
- Failed Test Highlights row below issue HOT 1
- Open to additional Maintainers? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-karma_test-explorer.