Comments (9)
You could try replacing socket.io with some "raw" networking code.
There's an example here from some (unfinished) experiments I did a while back to let the Mocha Test Adapter run mocha tests remotely. In that case I couldn't use the communication channel from node's child_process
package, so I wrote some IPC code myself:
createConnection()
will create a client connection, if the connection is rejected or closed immediately, it will keep retrying for a configurable amount of time and then give up.
receiveConnection()
is the counterpart on the server side: it will open a port for receiving connections and close it immediately when a connection is received (because we only want to accept exactly one connection). If no connection is received within a configurable amount of time, it will give up.
Both functions return a net.Socket
if the connection is successfully established. Now we need to put a simple message passing protocol on top of the raw data stream: I used JSON.stringify()
/JSON.parse()
and the split2
package for that, simply use the writeMessage()
/readMessages()
functions.
I haven't tested the code much, but I think it's worth a try.
from angular-karma_test-explorer.
Awesome! Glad to see your heroic effort come to fruition :)
from angular-karma_test-explorer.
Hey @hbenl yes for sure I will try that. Thank you very much. I am making some changes so the test mapping supports suites inside of suites(infinite amount) as currently only supports one level of suites. After that I will take a look at this ;). After this 2 changes I think a preview release will be ready. What do you think? Anything else you think I should include on an initial release?
from angular-karma_test-explorer.
I'd say release early, release often ;)
Even if it doesn't cover everything yet, the adapter will probably be useful for a lot of people already. Just point out in the Readme that it's still under development and that people should create and vote on issues - that will give you a clearer picture what remains to be done and what people need most urgently.
from angular-karma_test-explorer.
One more thought: It seems to me that this adapter could be easily adapted to support non-angular karma tests, so perhaps you might want to change the name to "Karma and Angular Test Explorer" or something similar (?) (even if the non-angular karma support will be done later)
from angular-karma_test-explorer.
@hbenl yeah you re right. I should decide on that before publishing. And yes I was planning on supporting karma as all the logic it's the same. I just need to add a new class that starts karma server instead of doing ng test. Should not be any issue at all.
from angular-karma_test-explorer.
@hbenl hey, so before publishing it I think the test explorer should be able to show the failure messages from angular when a test failed. I have the errors, for now I will just try to push it to the vscode output( eventually support decorations as in your jasmine-test-adapter). how do you do to show message in vscode output? also, I see a Test Explorer tab in the ouput, how can I send messages to that one?
from angular-karma_test-explorer.
For the failure message use TestEvent#message - it will be shown in the "Test Explorer" output channel when the test is clicked.
For the decorations use TestEvent#decorations.
from angular-karma_test-explorer.
https://marketplace.visualstudio.com/items?itemName=raagh.angular-karma-test-explorer
cant thank you enough. I am gonna keep working to make it great
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.