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

TAP format support #11

Closed
zoubin opened this issue Jun 8, 2016 · 5 comments · Fixed by #12
Closed

TAP format support #11

zoubin opened this issue Jun 8, 2016 · 5 comments · Fixed by #12

Comments

@zoubin
Copy link
Owner

zoubin commented Jun 8, 2016

#8 (comment)

@zoubin
Copy link
Owner Author

zoubin commented Jun 8, 2016

@RReverser

@Hypercubed
Copy link
Collaborator

tap-out considers lines like # as a "test" and adds them to the tests array (https://github.com/scottcorgan/tap-out/blob/master/lib/test.js#L17). I'm not sure if this is spec. I think technically # xxxx lines are comments. tap-summary uses the tests output to summarise the tests (https://github.com/zoubin/tap-summary/blob/master/lib/summarize.js#L23).

I'm not sure where the problem lies. I think there is a lot of sloppiness in all these TAP tools. I can never get node-tap output to parse by the consumers because of sub-tests and indention.

@RReverser
Copy link

I'm not sure if this is spec.

Yeah, as reported in original comment, it's not. Test lines in the spec are ok ... / not ok ..., and # is just a comment:

Diagnostics

Additional information may be put into the testing output on separate lines. Diagnostic lines should begin with a #, which the harness must ignore, at least as far as analyzing the test results. The harness is free, however, to display the diagnostics. Typically diagnostics are used to provide information about the environment in which test file is running, or to delineate a group of tests.

@Hypercubed
Copy link
Collaborator

Perhaps, if we are going to assume that the diagnostics delineate a group of tests if asserts are emitted without a group then a group should be added.

This can done here or in tap-out.

@zoubin
Copy link
Owner Author

zoubin commented Jun 12, 2016

if asserts are emitted without a group then a group should be added.

I think we can add an 'unnamed test' group here in such cases.
I've tried that in #12

Given

TAP version 13
1..4
ok 1 test 1
ok 2 test 2
ok 3 test 3
ok 4 test 4

The output will look like:

------------------------------------ Tests -------------------------------------

✔ unnamed test [pass: 4, fail: 0, duration: 6ms]

----------------------------------- Summary ------------------------------------

duration: 6ms
planned: 4
assertions: 4
pass: 4
fail: 0

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

Successfully merging a pull request may close this issue.

3 participants