Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voidberg/jasmine-bamboo-reporter
A reporter for Jasmine which produces a report compatible with Atlassian Bamboo Mocha Test Parser.
https://github.com/voidberg/jasmine-bamboo-reporter
Last synced: 2 months ago
JSON representation
A reporter for Jasmine which produces a report compatible with Atlassian Bamboo Mocha Test Parser.
- Host: GitHub
- URL: https://github.com/voidberg/jasmine-bamboo-reporter
- Owner: voidberg
- License: mit
- Created: 2015-10-28T14:25:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-11T13:56:50.000Z (almost 8 years ago)
- Last Synced: 2024-10-08T12:00:19.504Z (4 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jasmine-bamboo-reporter
[![view on npm](http://img.shields.io/npm/v/jasmine-bamboo-reporter.svg?style=flat)](https://www.npmjs.org/package/jasmine-bamboo-reporter)
[![npm module downloads per month](http://img.shields.io/npm/dm/jasmine-bamboo-reporter.svg?style=flat)](https://www.npmjs.org/package/jasmine-bamboo-reporter)
[![Dependency status](https://david-dm.org/voidberg/jasmine-bamboo-reporter.svg?style=flat)](https://david-dm.org/voidberg/jasmine-bamboo-reporter)> A reporter for Jasmine which produces a report compatible with Atlassian Bamboo Mocha Test Parser. It supports 'test sharding' or multiple instances of Jasmine running via Protractor. This support is handled by locking the results file and then merging with any previous results.
## Installation
```sh
npm install jasmine-bamboo-reporter
```## Usage
### Jasmine Usage
```javascript
var JSONReporter = require('jasmine-bamboo-reporter');
jasmine.getEnv().addReporter(new JSONReporter({
file: 'jasmine-results.json', // by default it writes to jasmine.json
beautify: true,
indentationLevel: 4 // used if beautify === true
}));//ensure there are no lock files and no previous results to merge against.
if (fs.existsSync("jasmine-results.json.lock")) fs.unlinkSync("jasmine-results.json.lock");
if (fs.existsSync("jasmine-results.json")) fs.unlinkSync("jasmine-results.json");```
### Protractor/Jasmine Usage
```javascript
// in Protractor conf
var JSONReporter = require('jasmine-bamboo-reporter');
var fs = require('fs');exports.config = {
framework: 'jasmine2',
...
beforeLaunch: function () {
//clean up any residual/leftover from a previous run. Ensure we have clean
//files for both locking and merging.
if (fs.existsSync('jasmine-results.json.lock')) {
fs.unlinkSync('jasmine-results.json.lock');
}
if (fs.existsSync('jasmine-results.json')) {
fs.unlink('jasmine-results.json');
}
},
onPrepare: function() {
jasmine.getEnv().addReporter(new JSONReporter({
file: 'jasmine-results.json', // by default it writes to jasmine.json
beautify: true,
indentationLevel: 4 // used if beautify === true
}));
}
```## License
[MIT](https://github.com/voidberg/jasmine-bamboo-reporter/blob/master/LICENSE)