xunit-file
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -13,3 +13,5 @@ /** | ||
, mkdirp = require("mkdirp") | ||
, filePath = process.env.XUNIT_FILE || config.file || process.cwd() + "/xunit.xml" | ||
, dateFormat = require('dateformat') | ||
, filePathParser = require('./file-path-parser')(process, global.Date, dateFormat) | ||
, filePath = filePathParser(process.env.XUNIT_FILE || config.file || "${cwd}/xunit.xml") | ||
, consoleOutput = process.env.XUNIT_SILENT ? {} : config.consoleOutput || {}; | ||
@@ -16,0 +18,0 @@ |
{ | ||
"name": "xunit-file", | ||
"description": "Basically the same reporter as mocha's xunit reporter, but writes the output in a file.", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"author": { | ||
@@ -21,2 +21,6 @@ "name": "Matthias Jahn", | ||
"email": "peter.janes@ek3.com" | ||
}, | ||
{ | ||
"name": "Nathan Fairhurst", | ||
"email": "nathan.p3pictures@gmail.com" | ||
} | ||
@@ -34,6 +38,8 @@ ], | ||
"dependencies": { | ||
"dateformat": "^1.0.12", | ||
"mkdirp": "^0.5.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5" | ||
"mocha": "^2.2.5", | ||
"sinon": "^1.17.3" | ||
}, | ||
@@ -40,0 +46,0 @@ "scripts": { |
@@ -26,3 +26,3 @@ xunit-file | ||
{ | ||
"file" : "xunit.xml", | ||
"file" : "${cwd}/xunit.xml", | ||
"consoleOutput" : { | ||
@@ -70,3 +70,26 @@ "suite" : true, | ||
**File Path Options** | ||
The file path accepts a few custom tokens to allow creation of dynamic file names. This can be useful for multithreaded testing (such as using a Selenium Grid) or to keep multiple files by timestamp. Tokens are in the following format: | ||
``` | ||
${tokenName: 'Token Data'} | ||
``` | ||
The available tokens are `pid` to inject the process id, `cwd` to inject the current working directory, and `ts` or `timestamp` to inject a timestamp. | ||
By default `ts` and `timestamp` use the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, ex: `2016-03-31T07:27:48+00:00`. However, if you specify a custom format in the Token Data, the timestamp uses the [node dateformat](https://github.com/felixge/node-dateformat) library to output a string in that format. | ||
A full example `config.json` is as follows: | ||
``` | ||
{ | ||
"file": "${cwd}/${timestamp: 'MMDD-hhmm'}/xunit-${pid}.xml" | ||
} | ||
``` | ||
This would output something like `~/myProject/1217-1507/xunit-1234.xml`. This example would keep copies good for a year without collision, and group multithreaded results by test run. | ||
Tokens can be used in either environment variables or a config.json. The default filepath is always `${cwd}/xunit.xml`. | ||
# Credits | ||
@@ -73,0 +96,0 @@ This reporter is just the original [xunit reporter](https://github.com/visionmedia/mocha/blob/master/lib/reporters/xunit.js) from mocha only writing the result in an xml file. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17649
12
330
99
2
2
+ Addeddateformat@^1.0.12
+ Addedarray-find-index@1.0.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddateformat@1.0.12(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)