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

Show filename for test.todo(...) #1062

Closed
mmkal opened this issue Oct 2, 2016 · 3 comments
Closed

Show filename for test.todo(...) #1062

mmkal opened this issue Oct 2, 2016 · 3 comments

Comments

@mmkal
Copy link
Contributor

mmkal commented Oct 2, 2016

Simple feature request... it'd be nice if the filename for a TODO test was shown (in the same way as it is for a failing test), so TAP parsers/IDEs can see them.

For example, with a Visual Studio Code task problem matcher, they could be flagged up as informational or warning problems. Then clicking on them in the "problems" view would take focus straight to the call to test.todo(...).

@sindresorhus
Copy link
Member

sindresorhus commented Oct 3, 2016

Yeah, that would be useful for our Atom and Sublime plugins too. I think we could add some custom metadata to the TAP output, like filepath, line, column. Actually, we should really include that info for all tests.

@ThomasBem
Copy link
Contributor

From what I have read about the TAP standard these additions we are talking about are outside of the specification, so we can call them and format them however we want?

So we could use your filepath, line and colum as a starting point, adding this to the output in both error and pass? https://github.com/avajs/ava/blob/master/lib/reporters/tap.js#L35:L51

Do we actually have access to that information when we are in the reporter though? As far as I know thats not in test.metadata or anything else?

@sindresorhus
Copy link
Member

From what I have read about the TAP standard these additions we are talking about are outside of the specification, so we can call them and format them however we want?

Yes. They should be added as data in the YAML-block. There we are free to add whatever data we want.

So we could use your filepath, line and colum as a starting point, adding this to the output in both error and pass? https://github.com/avajs/ava/blob/master/lib/reporters/tap.js#L35:L51

👍

Do we actually have access to that information when we are in the reporter though? As far as I know thats not in test.metadata or anything else?

Only for errors currently, but would be useful to have it in the metadata.

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