Add support for custom formatters
See original GitHub issueCurrently blocked on some work in progress that will change the formatters to look like the following
// suite - an event emitter
// log - function to call with output
// options - formatter options coming from cucumber
// snippetGenerator - function to call to generate snippet for an undefined step
// useColors - boolean of whether or not to use colors
function MyFormatter(suite, log, options) {
suite.on('beforeFeatures', function () {});
suite.on('beforeFeature', function (feature) {});
suite.on('beforeScenario', function (scenario) {});
suite.on('beforeStep', function (step) {});
suite.on('stepResult', function (stepResult) {});
suite.on('afterStep', function (step) {});
suite.on('scenarioResult', function (scenarioResult) {});
suite.on('afterScenario', function (scenario) {});
suite.on('afterFeature', function (feature) {});
suite.on('featuresResult', function (featuresResult) {});
suite.on('afterFeatures', function () {});
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Custom formatters in ASP.NET Core Web API - Microsoft Learn
This article shows how to add support for additional formats by creating custom formatters. For an example of a custom plain text input ......
Read more >1262914 - Add support for Custom Formatters in devtools
This bug should be used to add the support for Custom Formaters on the server, i.e. returning a new flavor of object grip...
Read more >Working with Custom Formatters - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Custom Formatters | Drupal.org
Create simple formatters from existing formatters with preset formatter settings. HTML + Tokens A HTML based editor with Token support. PHP A ...
Read more >Custom Formatters - MessageFormat
To define and add your own formatter, use the customFormatters option of the MessageFormat constructor: import MessageFormat from '@messageformat/core'; const ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you guys very much for the offer to contribute! Just to give you some background on the work in progress. So one big thing for changing the formatters to this syntax is a complete rework of how cucumber hooks in the formatters. That resulted in the need to remove
registerHandler
, something that I believe is largely used for beforeAll / afterAll hooks but with an inconsistent interface. I have a branch that removesregisterHandler
. That however is dependent on updating to using gherkin4 which is waiting on a new release of gherkin in order to properly support the browser version.I think I’ll just manually fix the bug with gherkin for browser support so we can keep moving. Sorry this has taken so long. I really want to get all my existing work in which should help us get close to this.
For anyone willing to contribute, please either pick up an issue or ping me on gitter with something you would like to work on. I’d ask that you create your first PR from a fork. Once I’ve worked with you to get one of your PRs in, I’m happy to give you commit access to the repo.
Just been reading through the previous PRs and this feels like the more ideal solution - let me know if there’s anything I can do to assist in getting this pushed out 👍