Git Product home page Git Product logo

Comments (13)

higgins1b avatar higgins1b commented on May 29, 2024 1

I am having the same issue.
Log is the same, environment is same(except I am using Angular 7.2.13).
Nothing in the Test Explorer Logs.

I am happy to include further details if you need them.

from angular-karma_test-explorer.

higgins1b avatar higgins1b commented on May 29, 2024 1

Yes, it works correctly if the angular application is in the workspace root.

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

Hey Steven, first of all thank you for submitting the bug, I will do my best to help you out.
No you don't need anything extra, I do not see anything in that callstack that can point to the problem.

  1. Could you upload for me a test project where I can replicate problem locally on my dev environment?.
  2. Are you using any configuration on the properties the test explorer exposes? if yes, could you let me know how you have it configured?.
  3. Do you have other test explorers( apart from Test Explorer UI and Angular/Karma Test Explorer) installed?.
  4. There is also an output channel in vscode called Test Explorer Logs, do you see any extra error there?

Hope we can fix this as soon as possible.

Thanks,
Patricio

EDIT: sorry if I sound like a stalker but I live in Antwerp too, nice to meet you ahah

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

Hey Michael thanks for answering, I will look at it tomorrow and let you guys know if I find something. Maybe something changed on the latest versions of angular.

Could any of you upload a test project for me where this happens? That would be of terrific help. Also please if you could answer the same questions I asked Steven that would be awesome ;).

Thank you both for downloading and reporting issues

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

@higgins1b @GoGoris I tried to reproduce it with a freshly new created project( latest angular version) on mac and windows but it seems to work fine.
Also tried with some real life examples and it worked( old versions of angular). I noticed a completely different bug that I will try to fix today. For fixing your bug I would really need more information or the test project so I can replicate it locally.

from angular-karma_test-explorer.

higgins1b avatar higgins1b commented on May 29, 2024

How does this tool target test files? I would like to try configuring it to target a single test file and see if I can get it to work.

When running ng test I have the cli created 'test.ts' file where I can define a glob to target specific test files. If I have an issue with tests running I update that file to grab a single file and start debugging.

Can I do something like that with this tool?

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

@higgins1b that's not possible, for that the tests need to load first.
Loading the tests: The test explorer start a child_process with ng test passing a custom karma config file(needed to avoid wrong behavior). after ng test has started(no tests will run at start) and there is an instance of karma running it runs a custom karma search using --grep="#%#@" this will not match any test so it will skip all tests and return them as skipped to the test explorer which loads them into the ui.

Running the tests: after the tests are loaded if you click on a test in the UI and click the run button. It will do a karma run event with --grep="name of the test" this will run a single angular test.

If you wanna help me out debugging it that would be awesome. Here are the contributing guidelines for the project it will contain the information you need to debug the test explorer and see whats going on.

from angular-karma_test-explorer.

higgins1b avatar higgins1b commented on May 29, 2024

@Raagh Thank you for your work, and for being active and responsive.

I think I have tracked it down, @GoGoris maybe you can confirm if your project is set up this way.

So, my angular project is within a folder in my workspace. If I open my angular project directly in the root of my workspace it works as expected(and it picks up only the tests I have targeted in the test.ts file).

This can be reproduced easily.

Steps to reproduce(you don't need to follow these steps exactly, this just illustrates the concept of not having the angular project directly in the workspace root):
Create a folder: my-app-workspace
Cd into folder: cd my-app-workspace
Create angular app in that folder: ng new my-app
Open new window in VS-Code
Choose 'Open Folder'
Select my-app-workspace

Notice no tests in the test explorer.

Can we tell the test-explorer where the angular project is in relation to workspace root?

I am happy to help as much as I can.

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

@higgins1b no worries, love to help.
Ahh yeah that indeed seems to be the issue. if you re not in the folder of the project the test explorer will not find your angular.json file, then tests will not be loaded( the error seen in the console seems is that I am returning and empty TestSuiteInfo and the test explorer UI is trying to map that and failing).

Sure I can add a configuration property on vscode so you can set the path for the angular.json ( the main issue with this is that configurations are not separated by workspace, so you will have to change it if you open another project).
I can also look into letting the user create a configuration file that must be in the root folder. in that case configuration could be setup by workspace.

just to confirm, if you open folder to the actual angular app the explorer works okey right?

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

Okey, lets wait for @GoGoris confirmation but I am gonna start trying some changes to get that configuration as soon as possible. It shouldn't be too complicated really.

Thanks for all your help 👍

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

I will close the bug as a feature request has been created with the same request @higgins1b @GoGoris.

apparently more people are in need of this feature. Thank you very much for helping me building this.

from angular-karma_test-explorer.

GoGoris avatar GoGoris commented on May 29, 2024

Thank you for your help! I reopened the angular project folder and now I see the tests in the test explorer. I guess this was indeed the problem. However when I add other folders to my workspace in version 0.2.1, I get weird results. I have not been able to reproduce it yet in a sample project. Sometimes I see no tests and sometimes I see the project in the test explorer as many times as there are folders open.

from angular-karma_test-explorer.

GoGoris avatar GoGoris commented on May 29, 2024

Update 0.2.1:
With multi project workspaces, one of the following occurs:

  1. I have this bug (map is undefined) and see no tests
  2. I see the tests duplicated #28

I also noticed that my editor freezes after opening the project a few times because a high amount of concurrent karma runners are spawned by the plugin: #29

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.