Skip to content

Commit

Permalink
treat # SKIP and # TODO the same. Closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
aghassemi committed Jan 20, 2017
1 parent a564d6e commit 6cb3345
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ function converter(options) {
}
});
}

// treat # SKIP and # TODO the same
// see https://github.com/aghassemi/tap-xunit/issues/8
testSuites.forEach(function(suite) {
suite.asserts.forEach(function(a) {
a.skip = a.skip || a.todo;
});
});

var xmlString = serialize(testSuites);
outStream.push(xmlString + '\n');
outStream.emit('end');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tap-xunit",
"version": "1.5.1",
"version": "1.6.0",
"description": "TAP to xUnit XML converter.",
"main": "lib/converter.js",
"bin": {
Expand Down
22 changes: 22 additions & 0 deletions test/expected/fail/todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<testsuites>
<testsuite name="withtodo" tests="4" failures="1" skipped="2" errors="0">
<testcase name="#1 passing and not todo"/>
<testcase name="#2 passing with todo">
<skipped/>
</testcase>
<testcase name="#3 failing with todo">
<skipped/>
</testcase>
<testcase name="#4 failing and not todo">
<failure>
---
operator: ok
expected: true
actual: false
at: Test.&lt;anonymous&gt; (/Users/aghassemi/github/tape/test.js:7:5)
...
</failure>
</testcase>
</testsuite>
</testsuites>
17 changes: 17 additions & 0 deletions test/input/fail/todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
TAP version 13
# withtodo
ok 1 passing and not todo
ok 2 passing with todo # TODO
not ok 3 failing with todo # TODO
not ok 4 failing and not todo
---
operator: ok
expected: true
actual: false
at: Test.<anonymous> (/Users/aghassemi/github/tape/test.js:7:5)
...

1..4
# tests 4
# pass 2
# fail 2

0 comments on commit 6cb3345

Please sign in to comment.