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

Returning the line number of the test in the TAP reporter #648

Closed
jacobmendoza opened this issue Mar 15, 2016 · 5 comments
Closed

Returning the line number of the test in the TAP reporter #648

jacobmendoza opened this issue Mar 15, 2016 · 5 comments

Comments

@jacobmendoza
Copy link

Is it feasible to return the line number of the test expression in the TAP reporter?. I don't mean the line of the assert failed. In fact, it would be interesting regardless the result of the test.

It could be very useful when developing extensions. In my case it would be nice for the Atom package. Having the line of the test could give me the ability to render the result besides the test in the text editor.

https://atom.io/docs/api/v1.5.3/TextEditor#instance-markScreenPosition
avajs/atom-ava#3

I am not very familiar with the codebase, and I'm just guessing. I don't know if we have an analysis/parsing process of the file (I don't see it). As far as I can see now, the reporters receive a structure as:

{ duration: 165, title: 'foobar', error: null, type: 'test', skip: false, todo: false, file: 'test1.js' }

I can think of a different solution, trying to parse that myself. But I would like some feedback about if it is actually possible.

Thank you!

@jamestalmage
Copy link
Contributor

node-tap already does this using at property of the yaml output.

@novemberborn
Copy link
Member

@jacobmendoza could you clarify what output you like to see? The line of each assertion? Or the line of the test? Regardless of whether the tests fail?

@jamestalmage
Copy link
Contributor

Oh - missed that you wanted this for passing tests/assertions.

We could probably accommodate with a babel-plugin. I'm not opposed, but I think it's low-priority.

@OmgImAlexis
Copy link

Is there anything I could do to help get this moving along?

@novemberborn
Copy link
Member

Is there anything I could do to help get this moving along?

@OmgImAlexis PR welcome, I suppose, but I'm not overly familiar with TAP and I can't immediately tell by this issue description what the next steps would be.

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

No branches or pull requests

5 participants