octobertest
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,1 +0,1 @@ | ||
module.exports = require('./lib/test'); | ||
module.exports = require('./lib/test'); |
var stringifier = require('./stringifier'), | ||
parser = require('./parser'), | ||
; |
@@ -21,3 +21,3 @@ /** @const */ | ||
'</testsuite>'; | ||
} | ||
}; | ||
@@ -34,5 +34,5 @@ /** | ||
return '<testcase name="' + escapeInvalidXmlChars(test.name) + '">' + | ||
inner | ||
inner + | ||
'</testcase>'; | ||
} | ||
}; | ||
@@ -48,2 +48,2 @@ /** | ||
.replace(/\'/g, "'"); | ||
} | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Convert between different test result formats", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"homepage": "https://github.com/uxebu/octobertest", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -7,1 +7,48 @@ # octobertest | ||
into JUnit.xml for jenkins. | ||
## Usage | ||
octobertest -i json -o xml foo.json bar.xml | ||
Formats will be guessed from file extensions, so this will also work: | ||
octobertest foo.json bar.xml | ||
## Example conversion | ||
This JSON: | ||
~~~ json | ||
{ "suites": | ||
[ | ||
{ | ||
"name": "foo", | ||
"tests": [ | ||
{ | ||
"name": "Foo should bar the baz", | ||
"passed": false, | ||
"expected": 1337, | ||
"actual": 1338, | ||
"error": "Expected 1337 to be 1338", | ||
"stacktrace": "foo()\nbar()\nbaz()\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
~~~ | ||
would result in the following JUnit XML output: | ||
~~~ xml | ||
<?xml version="1.0" encoding="UTF-8" ?><testsuites><testsuite name="foo"><testcase name="Foo should bar the baz"><failure message="Expected 1337 to be 1338">foo() | ||
bar() | ||
baz() | ||
</failure></testsuite></testsuites> | ||
~~~ | ||
## JSON format | ||
The JSON format is very alpha and hasn't been battle tested yet. | ||
It is contrived to having test suites with test cases. | ||
Ideally it should also just accept a simple list of tests and derive the suite name from the file name. |
6650
152
53
18