diff --git a/lib/converter.js b/lib/converter.js index 8615b97..ae7ddf9 100644 --- a/lib/converter.js +++ b/lib/converter.js @@ -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'); diff --git a/package.json b/package.json index 9bd04b6..b7b41f0 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/expected/fail/todo b/test/expected/fail/todo new file mode 100644 index 0000000..b5ffde9 --- /dev/null +++ b/test/expected/fail/todo @@ -0,0 +1,22 @@ + + + + + + + + + + + + + --- + operator: ok + expected: true + actual: false + at: Test.<anonymous> (/Users/aghassemi/github/tape/test.js:7:5) + ... + + + + \ No newline at end of file diff --git a/test/input/fail/todo b/test/input/fail/todo new file mode 100644 index 0000000..08ffa44 --- /dev/null +++ b/test/input/fail/todo @@ -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. (/Users/aghassemi/github/tape/test.js:7:5) + ... + +1..4 +# tests 4 +# pass 2 +# fail 2 \ No newline at end of file