Comments (7)
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.
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.
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.
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.
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.
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.
That sounds awesome. I will create the feature request.
Again, thanks for the fast responses.
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
- Unable to see tests in Test Explorer using HOT 12
- 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.