question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reporter API: spec started event

See original GitHub issue

Feature request for IntelliJ integration. Now reporter is notified when a spec execution is finished. It’d be better for user to be see what tests are executed at the moment. It’d be nice to have onSpecStarted(browser, spec) in BaseReporter.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
devoto13commented, Mar 30, 2022

No, I’m afraid, we don’t have much documentation on the internals… This high-level overview is probably the best we’ve got.

Just to give you some hints:

  • We’ve got this violation of the grep test, so often onSpecComplete is a handler for the emit('spec_complete') event. So keep that in mind when looking for usages.
  • You can find events sent by browser by looking for socket.emit in the client code.
  • These events are then received by the server code.
  • Which in turn produces other events which are received by the reporters.

So you would need to add a method to the client code to send new spec started event, receive it on the server side and pass it to the reporter. Then framework plugins should start using this method to send the event and reporter plugins can make use of it. That’s where I’m not sure how we can land it safely… Because somebody can have a reporter expecting this event, but framework which does not send it.

Looking at the karma-jasmine code, I’ve noticed that they seem to use info event ot pass custom payloads, but they don’t seem to be used. Not sure what is going on there.

1reaction
AbdealiLoKocommented, Mar 30, 2022

Understood @devoto13 - Let me see how far I can go. I do have some time limitations too - but I’m hopeful I have seen a lot of inconveniences that this will resolve, and a lot of developers getting confused about error logs coming in before the testsuite getting reported etc.

I can definitely check karma-jasmine, but I have never used karma-mocha before. But I generally feel like backward compatibility would be required.

I will spend some time on looking through the code and understanding the current websocket protocol and come up with some ideas on implementation. Would you have any documentation I could read regarding the internals ? Or just going through the code is best

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interface: Reporter - Jasmine Documentation
jasmineStarted is called after all of the specs have been loaded, but just before execution starts. Parameters: Name, Type, Attributes, Description. suiteInfo ...
Read more >
Reporting API - MDN Web Docs - Mozilla
The Reporting API provides a generic reporting mechanism for web applications to use to make reports available based on various platform ...
Read more >
Preceptor-Reporter - GitHub
Reporting library for the preceptor test-runner and aggregator - GitHub ... ####Spec The Spec reporter will print all test-events in an ordered and ......
Read more >
Custom Reporter - WebdriverIO
You can register an event handler for several events which are triggered during testing. All of the following handlers will receive payloads with...
Read more >
Tutorial: Create a Custom Reporter - Documentation - Mocha
Events ; EVENT_TEST_PENDING, pending, Test, A Test was skipped. ; EVENT_TEST_RETRY, retry, Test , Error, A Test failed, but is about to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found