Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: 3rd party formatters #42

Closed
wants to merge 3 commits into from
Closed

Proposal: 3rd party formatters #42

wants to merge 3 commits into from

Conversation

Freyert
Copy link

@Freyert Freyert commented Dec 1, 2017

The tap-mocha-reporter exposes a more convenient interface for certain use cases than the tap-parser. It would be nice to be able to create 3rd party reporters to use with tap-mocha-reporter.

This is just a cheap trick that I've created to work around my issue, but it would be nice to formalize a system for 3rd party formatters.

Issues

  1. Can't load project local node_modules without adding it via NODE_PATH.

@rmg
Copy link
Member

rmg commented Dec 1, 2017

Can't load project local node_modules without adding it via NODE_PATH.

This doesn't make sense. Are you using a globally installed tap instead of a local versions (as per devDependencies)? Or perhaps you've done npm link, in which case resolution will be relative to your tap module's location..

@Freyert
Copy link
Author

Freyert commented Dec 1, 2017

Ah, yes I was using file: in the package.json for the third party module. Let me try differently.

@Freyert
Copy link
Author

Freyert commented Dec 1, 2017

That's fixed it, thanks @rmg.

@Freyert
Copy link
Author

Freyert commented Dec 1, 2017

After looking at this a bit more, this seems like the easiest insertion to add this functionality. Editing the error message to include the caveat: "Perhaps you were attempting to load a 3rd party reporter; please ensure it exists in the require path," would improve the quality.

Tests as well :}

Fulton Byrne added 2 commits December 5, 2017 13:32
can it be required

error handling if reporter is bad

missing error maintained
@darvin
Copy link

darvin commented May 31, 2018

bump

@wking
Copy link

wking commented Jun 7, 2018

Passing in a reporter function (as supported by this PR) looks useful to me for folks calling this from JavaScript. Another approach (potentially more useful from the tap CLI) would be loading a 3rd-party package using require(...). I've submitted #48 with an implementation for that. This package could support both approaches, although there will be trivial conflicts between the PRs as we get them landed.

@Freyert Freyert closed this Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants