diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c5ee4f --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2016 Dan Homola + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 4c72db7..94dca30 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,55 @@ # jest-trx-results-processor -Jest results processor for exporting into TRX files for Visual Studio +This package is used to export a TRX file from [Jest](https://facebook.github.io/jest/) test runs to be used in [Visual Studio](https://www.visualstudio.com/) and [Visual Studio Team Services](https://www.visualstudio.com/vsts-test/). + +## Usage + +First install the package to your project from npm as a `devDependency`: +``` +npm install jest-trx-results-processor --save-dev +``` +or if you prefer [`yarn`](https://yarnpkg.com/): +``` +yarn add --dev jest-trx-results-processor +``` + +Then create a `jestTrxProcessor.js` file somewhere in your project (for this example I'll assume the `scripts` folder). +There you can configure the processor, as Jest does not allow you to pass custom parameters to the results processor: +```js +var builder = require('jest-trx-results-processor'); + +var processor = builder({ + outputFile: 'relative/path/to/resulting.trx' // this defaults to "test-results.trx" +}); + +module.exports = processor; +``` + +Finally point Jest to your results processor in the `package.json`: +```json +{ + ... + "devDependencies": { + ... + "jest": "^16.0.1", + "jest-trx-results-processor": "~0.0.1", + ... + }, + ... + "jest": { + ... + "testResultsProcessor": "scripts/jestTrxProcessor", + ... + } +} +``` + +Then you just run Jest as you normally would. + +Minimal working configuration can be seen in the [examples folder](https://github.com/no23reason/jest-trx-results-processor/tree/master/examples). + +## Acknowledgements +This tool is heavily inspired by [karma-trx-reporter](https://github.com/hatchteam/karma-trx-reporter). + +## License + +*jest-trx-results-processor* is available under MIT. See [LICENSE](https://github.com/no23reason/jest-trx-results-processor/tree/master/LICENSE) for more details. diff --git a/examples/package.json b/examples/package.json index 0055560..7ceb9d6 100644 --- a/examples/package.json +++ b/examples/package.json @@ -13,7 +13,6 @@ "jest-trx-results-processor": "~0.0.1" }, "jest": { - "testRegex": "tests", "testResultsProcessor": "scripts/jestTrxProcessor" } } \ No newline at end of file diff --git a/examples/scripts/jestTrxProcessor.js b/examples/scripts/jestTrxProcessor.js index a7bab2d..6ed3258 100644 --- a/examples/scripts/jestTrxProcessor.js +++ b/examples/scripts/jestTrxProcessor.js @@ -1,7 +1,7 @@ var builder = require('jest-trx-results-processor'); var processor = builder({ - outputFile: 'relative/path/to/resulting.trx' + outputFile: 'relative/path/to/resulting.trx' // this defaults to "test-results.trx" }); module.exports = processor; diff --git a/package.json b/package.json index e7424d9..3c9b637 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,23 @@ "name": "jest-trx-results-processor", "version": "0.0.1", "description": "Jest results processor for exporting into TRX files for Visual Studio", + "author": "Dan Homola", + "user": "no23reason", + "license": "MIT", "main": "dist/index.js", "repository": { "url": "https://github.com/no23reason/jest-trx-results-processor", "type": "git" }, - "author": "Dan Homola", - "user": "no23reason", - "license": "MIT", + "bugs": { + "url": "https://github.com/no23reason/jest-trx-results-processor/issues" + }, + "keywords": [ + "jest", + "jestjs", + "jest-cli", + "trx" + ], "scripts": { "prepublish": "npm run build", "build": "tsc",