Git Product home page Git Product logo

Comments (7)

Raagh avatar Raagh commented on May 29, 2024 1

No worries, thank you for taking the time to suggest this!. I have too say that the best features I have built on this came from users like you. So thank you

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

Hi @Nvveen let's see if I understand the question.

When you run the tests by using 'ng test' a chrome window is opened and you see the UI chaging while your tests run?
If that's the case that is done by using a Karma Reporter, this plugin will run all the karma reporters you have, this means that if you use the plugin with that reporter in your karma.conf.js file, when you run the tests and open a chrome window you should see that same thing(though maybe its related to the fact that I launch ChromeHeadless instead of regular Chrome)

I could try to support that if needed but I will need a test project you try it out since I don't work with that configuration.

from angular-karma_test-explorer.

Nvveen avatar Nvveen commented on May 29, 2024

Hi @Raagh,

Thanks for the amazingly fast response. To simplify the configuration, I tested with a newly generated Angular project with AngularCLI. Running npm test opens the runner in a Chrome instance, with the newly created main component as a result of running the unittest. Running the same test in the test explorer completes the test as expected, but going to http://localhost:9876 (same address:port as npm test), shows only the Karma header without saying which tests have been run and no output of the component from those tests.
I suspect it is indeed because of the startup command the plugin uses to start Chrome, but is there a way to support configuration of these startup arguments so I can run singular tests with your plugin and view the output in the browser or alternatively have the plugin also open a Chrome instance in the same way as npm test?

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

There is no way currently to run the tests from the plugin and see the results in the browser as they re completely separate instances, the plugin uses a ChromeHeadless and when you go the url is just a Chrome instance.

Can I ask you why re you doing this?
The whole idea of the plugin is to avoid using chrome, you see the tests in the test explorer, run them individually from the test explorer(by using the play button) and see the results in there, you also can see the exceptions or go directly to the source code.
What is the benefit you find in opening a chrome window?

from angular-karma_test-explorer.

Nvveen avatar Nvveen commented on May 29, 2024

Well, it's not necessary, of course, but it's a way to visually see the component while each test is being run to iterate development of the component. Another option is to run the development server and open that in a browser window, but my thought was that it's better to see how each component looks in isolation, i.e. in every instance of a unit test. My test-workflow is that I run the Karma-driven tests, see the result of each unit test and if adjustments need to be made to the component because a unit test fails or whatever, I can see the result of those adjustments in Karma, instead of having to have the development browser also running. Having each unit test runnable from VSCode and most of all, being able to manually select unit tests to run is a major boon, so that last aspect of my development and testing workflow also being possible with the plugin would be a big plus.
Of course, I don't know without studying the source code if being able to configure the startup of Karma is a major feature request.

from angular-karma_test-explorer.

Raagh avatar Raagh commented on May 29, 2024

It should not be that hard I guess, I will need to read the browsers from the karma.conf.js of the user instead of just using ChromeHeadless and see it happens, to be honest I haven't tried that myself. I am gonna give a try and see what happens.

I will let you know when I have a test build for you so you can tell if that suits your needs. If you want to keep track of this feature could you create feature request? I want to keep information as ordered as possible here :)

from angular-karma_test-explorer.

Nvveen avatar Nvveen commented on May 29, 2024

That sounds awesome. I will create the feature request.

Again, thanks for the fast responses.

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.