Skip to content

TAP report prints test titles above not ok message #679

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

Closed
will-weiss opened this issue Mar 23, 2016 · 5 comments
Closed

TAP report prints test titles above not ok message #679

will-weiss opened this issue Mar 23, 2016 · 5 comments
Labels
bug current functionality does not work as desired help wanted

Comments

@will-weiss
Copy link

Description

The TAP report prints the failing assertion rather than the title of the test after the not ok message. If I have a test file test.js that reads:

import { test } from 'ava';

test('one should equal two', t => {
  t.is(1, 2);
});

and I run ava --tap, the resulting TAP report looks like this:

TAP version 13
# one should equal two
not ok 1 - 1 === 2
  ---
    operator: ===
    expected: 2
    actual: 1
    at: _callee$ (test.js:4:4)
  ...

1..1
# tests 1
# pass 0
# fail 1

This is an issue because I am using a Jenkins TAP Plugin that reports the titles of the tests incorrectly, as it interprets 1 - 1 === 2 as the name of the test. I would expect the TAP report to look like this:

TAP version 13
# one should equal two
not ok 1 - one should equal two
  ---
    operator: ===
    expected: 2
    actual: 1
    at: _callee$ (test.js:4:4)
  ...

1..1
# tests 1
# pass 0
# fail 1

If this is an issue with a dependency of ava and not with ava itself, please direct me to that project instead and I'll be happy to file an issue there.

Thanks in advance!

Environment

Node.js v5.9.0
darwin 14.5.0

@novemberborn
Copy link
Member

Hi @will-weiss thanks for your report. I believe this is a duplicate of #324.

@novemberborn
Copy link
Member

Actually I'm not sure now. @jamestalmage?

@novemberborn novemberborn reopened this Apr 5, 2016
@jamestalmage
Copy link
Contributor

Yeah - This is a legit issue. Related to #324, but not identical. I have tap-emitter in the works.

help wanted!

@jamestalmage jamestalmage mentioned this issue Apr 5, 2016
7 tasks
@novemberborn novemberborn added bug current functionality does not work as desired help wanted labels Apr 6, 2016
@sotojuan
Copy link
Contributor

sotojuan commented Apr 6, 2016

@jamestalmage For now is it fine to submit a PR that changes

format('not ok %d - %s', ++this.i, test.error.message),

with

format('not ok %d - %s', ++this.i, test.title),

In lib/reporters/tap.js? Seems like that would emit the output @will-weiss wants.

@jamestalmage
Copy link
Contributor

Works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired help wanted
Projects
None yet
Development

No branches or pull requests

4 participants