Git Product home page Git Product logo

Comments (5)

Raagh avatar Raagh commented on June 10, 2024

Hi pierre, thank you for submitting the bug. I will take a look at it tonight when I get home and create a test to reproduce it. That stacktrace seems to be enough to fix it. Could you do one try just to be sure, if you try it on a freshly created angular cli project does it work?

from angular-karma_test-explorer.

Raagh avatar Raagh commented on June 10, 2024

@plchampigny I just pushed the fix for your problem. In a few minutes the new version should be built and published by the pipeline.

The problem is that if that's the case then some of your tests don't have a filePath(its undefined) then for those tests the show source function will not work.

I have tried it with my work project, and with a freshly created angular cli project and it works on both. could you provide me with an example test that doesn't have a filePath? could you show me your test structure so I can replicate the problem?

from angular-karma_test-explorer.

plchampigny avatar plchampigny commented on June 10, 2024

@Raagh I'm testing the new extension, I've was about to post an error but it seems my vscode didnt reload the extension. I'll be investigating on my side which test doesnt have the goto file feature and check the reason why they dont.

from angular-karma_test-explorer.

plchampigny avatar plchampigny commented on June 10, 2024

@Raagh Okay I found out the issue. We created internally a decorator system to create jasmine test using classes. For example:

@TestSuite('MyTestSuite')
export class MyTestSuite {
  @BeforeEach()
  public beforeEach() {
  }
 
  @Test()
  public async someTest() {
  }
}

will generate a suite with the name MyTestSuite and the someTest test

Looking at your code, I think you match the files content to find the test matching those files. Having a way to configure the regex to match these decorator for me would be wonderful.

from angular-karma_test-explorer.

Raagh avatar Raagh commented on June 10, 2024

@plchampigny I understand the system, but I don't understand why tests are not being matched.

If you create the jasmine tests using those classes the "angular-karma_test-explorer/src/core/shared/path-finder.ts" should still found those jasmine tests that were created and use those. It will not map to the classes for sure but why is not mapping to those created jasmine tests? can you give me an example test class that is created? is your structure not matching the pattern used for getting the paths in this line ?

I am afraid that just having a property for the regex will not be enough if you re planning to match spec names to the classes instead of the test files, as PathFinder is also expecting to find keywords like "describe" and "it" it would need a complete new implementation. Maybe I can make a plugin implementation so that you can submit your own PathFinder implementation to the explorer and use that one instead. I need to do more investigation on this subject.

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.