Skip to content

Commit

Permalink
Improve README, add LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
no23reason committed Oct 16, 2016
1 parent 112105d commit 4ef2743
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 6 deletions.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"jest-trx-results-processor": "~0.0.1"
},
"jest": {
"testRegex": "tests",
"testResultsProcessor": "scripts/jestTrxProcessor"
}
}
2 changes: 1 addition & 1 deletion examples/scripts/jestTrxProcessor.js
Original file line number Diff line number Diff line change
@@ -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;
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4ef2743

Please sign in to comment.