Skip to content
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

How to get Assertion Error in after hook? #2219

Closed
smyth64 opened this issue Aug 20, 2019 · 3 comments
Closed

How to get Assertion Error in after hook? #2219

smyth64 opened this issue Aug 20, 2019 · 3 comments

Comments

@smyth64
Copy link

smyth64 commented Aug 20, 2019

Hi,
I want to get the assertion error after each failed test in order to write it in my database.

How can I achieve that?

@novemberborn
Copy link
Member

Could you expand on your use case? It might be better to use the TAP reporter and process the resulting file.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

@smyth64
Copy link
Author

smyth64 commented Aug 20, 2019

@novemberborn
I was just curious how I can pass the context to the tap output? It seems impossible =/ I want to give some payload information about the errors from the external micro service and some IDs that are generated in the test.

Is there any possibility?

@novemberborn
Copy link
Member

You could log some of that information and it should show up in the TAP output but it won't be structured.

From the looks of it, you're trying to do something a bit beyond just testing your code. That's great but not AVA's core focus.

When we land #1947 you'll have some access to the assertion failures so you could construct something on top of AVA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants