-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Proposal][circus] Add assertion events to jest-circus or event custom events #10059
Comments
@SimenB hey any chance this could happen? What are some next steps to promote such a feature request in Jest? |
I'm a bit worried about coupling the test runner strongly to the assertion library here. There's only a tiny bit of code in |
Thank you for your response! From my hight level goal: Any help from jest side so I won't need to patch things to get instrumentations would be super helpful (And not only for my use case :)) Or even if I will patch the assertion library myself, using circus events to get the data out would be nicer than using my own mechanism. Examining circus code, I see how i can add my custom events by writing my own circus-based runner, or requiring
I totally agree, if that's sounds reasonable enough I can open more focused proposal
For my use case I'm avoiding that part by writing to disk in a known location per test (by test name, and all) |
So for For the |
Sorry for diverging from the main topic, but: Both the events api & report api may be exposed to the jest environment, or even the test itself |
Would it be helpful to jump on a quick call and explain the use case we have for this? We will (happily) allocate developer time to work on adding this (custom metadata) to circus but I think it also makes sense to add hooks into assertions. There are multiple use cases for detecting successful assertions including but not limited to:
On the other hand, an implementation should not penalize users not using events in terms of performance or API - in bluebird we did this with config (called "monitoring"). |
While some sort of hook for adding custom events might make sense at some point, I think assertions are such an integral part of test runners that Not sure how to best make |
@SimenB What do you think the best way to move it forward? I thinking about:
Regarding adding opaque data to reporter api, |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Add assertion events to jest circus,
and expose api for custom assertion libraries to emit events as-well
Motivation
Jest circus events provide valuable info during test execution.
I believe that adding events for assertions will give even a better picture of what's going on during the event execution.
My personal motivation is that I'm writing a tool that extends jest to show additional information on test runs & during test runs, and to be able to also show successful assertions.
Without standard way from jest side, I would have to wrap the assertion library myself.
That can be helpful to various tools,
And maybe even solve things like:
#6295 (comment)
Example
I don't have something very solid in mind, but if we take a look at:
Very crud dump of jest circus events during test run:
The events i'm thinking about are (They must be sync, the return promise api is not applicable here unfortunately):
With additional metadata that would make sense there
Pitch
I think the power of jest-circus is the best pitch :)
Exposing more information as events from the test runs and even custom events, will give more power to external tools without the need to to integrate with the core directly, monkey patch or wrap things etc
The text was updated successfully, but these errors were encountered: