Giter Site home page Giter Site logo

Comments (12)

harris-authors avatar harris-authors commented on May 23, 2024 1

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.

callumcarolan-clevertech avatar callumcarolan-clevertech commented on May 23, 2024

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.

mbrechet avatar mbrechet commented on May 23, 2024

Hi, same problem for me too. Is there a workaround ?

from angular-karma_test-explorer.

callumcarolan-clevertech avatar callumcarolan-clevertech commented on May 23, 2024

I have not found a workaround for this yet

from angular-karma_test-explorer.

mbrechet avatar mbrechet commented on May 23, 2024

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.

callumcarolan-clevertech avatar callumcarolan-clevertech commented on May 23, 2024

@mbrechet What did you modify in the configuration?

from angular-karma_test-explorer.

mbrechet avatar mbrechet commented on May 23, 2024

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.

s4m0r4m4 avatar s4m0r4m4 commented on May 23, 2024

I've run into this as well. For me the issue was this:

  1. This extension assumes the target to launch from the selected project is called "test" and that it has a "karmaConfig" option specified.
  2. 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)
  3. 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.

callumcarolan-clevertech avatar callumcarolan-clevertech commented on May 23, 2024

I've run into this as well. For me the issue was this:

  1. This extension assumes the target to launch from the selected project is called "test" and that it has a "karmaConfig" option specified.
  2. 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)
  3. 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.

s4m0r4m4 avatar s4m0r4m4 commented on May 23, 2024

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.

callumcarolan-clevertech avatar callumcarolan-clevertech commented on May 23, 2024

from angular-karma_test-explorer.

s4m0r4m4 avatar s4m0r4m4 commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.