question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for custom formatters

See original GitHub issue

Previous PRs #215 #257 #309

Currently 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:closed
  • Created 8 years ago
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
charlierudolphcommented, May 4, 2016

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 removes registerHandler. 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.

1reaction
benhoIIandcommented, Feb 24, 2016

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 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found