cucumber-pretty
Advanced tools
Comparing version 0.0.4 to 0.0.5
40
index.js
@@ -29,6 +29,32 @@ const { Formatter, SummaryFormatter } = require('cucumber'); | ||
const features = []; | ||
options.eventBroadcaster.on('test-case-started', event => { | ||
const data = this.eventDataCollector.getTestCaseData(event.sourceLocation); | ||
if (!features.includes(event.sourceLocation.uri)) { | ||
const feature = data.gherkinDocument.feature; | ||
this.log(EOL); | ||
if (feature.tags.length) { | ||
const tags = this.color('tag', feature.tags.map(tag => tag.name).join(' ')); | ||
this.log(`${tags}${EOL}`); | ||
} | ||
const keyword = this.color('blue', feature.keyword); | ||
this.log(`${keyword}: ${feature.name}${EOL}`); | ||
features.push(event.sourceLocation.uri); | ||
} | ||
this.log(EOL); | ||
if (data.pickle.tags.length) { | ||
const tags = this.color('tag', data.pickle.tags.map(tag => tag.name).join(' ')); | ||
this.log(` ${tags}${EOL}`); | ||
} | ||
const keyword = this.color('blue', 'Scenario'); | ||
this.log(`${EOL} ${keyword}: ${data.pickle.name}${EOL}`); | ||
this.log(` ${keyword}: ${data.pickle.name}${EOL}`); | ||
}); | ||
@@ -56,11 +82,11 @@ | ||
options.eventBroadcaster.on('test-case-finished', event => { | ||
}); | ||
// options.eventBroadcaster.on('test-case-finished', event => { | ||
// }); | ||
options.eventBroadcaster.on('test-run-finished', event => { | ||
if (this.option('summary', true)) { | ||
if (this.option('summary', true)) { | ||
options.eventBroadcaster.on('test-run-finished', event => { | ||
this.log(EOL); | ||
new SummaryFormatter(this.noptions).logSummary(event); | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -67,0 +93,0 @@ |
{ | ||
"name": "cucumber-pretty", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Cucumber.js Pretty Formatter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,4 +33,4 @@ # Cucumber.js Pretty Formatter | ||
- [ ] Log Feature | ||
- [ ] Log @tags | ||
- [x] Log Feature (v0.0.5) | ||
- [x] Log @tags (v0.0.5) | ||
- [ ] Log descriptions | ||
@@ -41,4 +41,1 @@ - [ ] Log data tables | ||
- [x] Colour Gherkin keywords (v0.0.4) | ||
- [ ] Option to log step in started (logging order) or finished (result colour) event | ||
- [ ] Support custom loggers | ||
- [ ] Refactor indenting |
6510
97
40