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

Support custom reporters - closes #216 & closes #309 #317

Merged
merged 1 commit into from Mar 4, 2015

Conversation

@phated
Copy link
Contributor

phated commented Mar 3, 2015

The implementation I went with is: if a string passed to the reporter option doesn't exist in the internals.proto map, just attempt to require it. I also added simple logic for relative vs npm-installed reporters.

@@ -18,10 +18,17 @@ internals.protos = {
tap: require('./tap')
};

internals.requireReporter = function (reporter) {
if (reporter.indexOf('.') === 0) {

This comment has been minimized.

Copy link
@geek

geek Mar 4, 2015

Member

our style is to add a newline when we create new scopes: http://hapijs.com/styleguide

This comment has been minimized.

Copy link
@Marsup

Marsup Mar 4, 2015

Member

also reporter[0] === '.' ?

@geek

This comment has been minimized.

Copy link
Member

geek commented Mar 4, 2015

Please add documentation to the readme about this enhancement, and how the require works.

@geek geek added the feature label Mar 4, 2015
@geek geek self-assigned this Mar 4, 2015
@phated phated force-pushed the iceddev:custom-reporters branch 2 times, most recently from e9693b8 to 6cc9957 Mar 4, 2015
@phated phated force-pushed the iceddev:custom-reporters branch from 964b8ce to dc8cdd6 Mar 4, 2015
@phated

This comment has been minimized.

Copy link
Contributor Author

phated commented Mar 4, 2015

Updated, rebased and added documentation.

@geek geek added this to the 5.4.1 milestone Mar 4, 2015
@geek geek changed the title add support for custom reporters - closes #216 & closes #309 Support custom reporters - closes #216 & closes #309 Mar 4, 2015
geek added a commit that referenced this pull request Mar 4, 2015
Support custom reporters - closes #216 & closes #309
@geek geek merged commit 72d3a70 into hapijs:master Mar 4, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@geek

This comment has been minimized.

Copy link
Member

geek commented Mar 4, 2015

@phated nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.