Re: How to add a custom reporter

311 views
Skip to first unread message

Vojta Jína

unread,
Feb 2, 2013, 5:47:32 PM2/2/13
to testa...@googlegroups.com
Norbert, this is really cool - a blink1 reporter. Really awesome ;-)

I'm in the middle of refactoring testacular to allow plugins (https://github.com/vojtajina/testacular/tree/using-di), once this is done, it should be super simple to add a custom reporter as a standalone npm module. (All reporters, launchers, adapters, preprocessors will be just plugins - separate npm modules).

V.


On Fri, Feb 1, 2013 at 12:09 PM, <norr...@gmail.com> wrote:
Hello,

is there a way to add a custom reporter to testacular? I would like to access a blink1 device (http://blink1.thingm.com/) in a reporter and change its color based on the test output. 
In fact I have already hacked together a new reporter and everything is working fine except that I had to modify reporter.js to add a special case for my new reporter. Is there really no other way to do this?

Best regards,
Norbert

--
You received this message because you are subscribed to the Google Groups "testacular" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testacular+...@googlegroups.com.
To post to this group, send email to testa...@googlegroups.com.
Visit this group at http://groups.google.com/group/testacular?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Norbert Schneider

unread,
Feb 3, 2013, 11:21:04 AM2/3/13
to testa...@googlegroups.com
Hey, that's great! I will look out for the refactoring to hit a public branch or maybe have a sneak peek at yours.

Norbert

Vojta Jína

unread,
May 4, 2013, 12:14:14 AM5/4/13
to karma...@googlegroups.com
The refactoring is done. Karma 0.9+ (currently in canary channel) already has support for plugins.

V.


On Thu, May 2, 2013 at 7:21 PM, Eddie <ed...@eddiewould.com> wrote:
How did you get on with the refactoring to allow plugins?

I'm in the same boat (I've written a custom adaptor + reporter) but I had to hack reporter.js & config.js to get it to pick it up.


Cheers,
Eddie

--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users?hl=en.

ed...@eddiewould.com

unread,
May 6, 2013, 10:02:51 PM5/6/13
to karma...@googlegroups.com
Hi Vojta,

I'm working off Karma 0.9.2 (Canary). I've successfully got a custom reporter going, however I couldn't see any obvious provision for custom settings in the config file (my reporter would like to specify an output directory, in the same way we do for the coverage reporter).

From looking at the code, it looks as though settings from the config file will only be merged into the config object if they're known about (i.e. included in the defaultConfig - config.js::parseConfig).

How should I be doing this?


Cheers,
Eddie

ed...@eddiewould.com

unread,
May 7, 2013, 7:13:45 PM5/7/13
to karma...@googlegroups.com
Never mind, looks like you're onto it (https://github.com/karma-runner/karma/pull/533)


Cheers,
Eddie

Vojta Jína

unread,
May 11, 2013, 2:18:17 AM5/11/13
to karma...@googlegroups.com
Hi Eddie,

the error from your first email is network connection refused - the phantomjs npm package is just a wrapper, it wants to fetch phantom binary during the install - so I guess that's a problem of your proxy (nothing to do with NPM or Karma).

As for config, this is already possible in the master (it's not released yet, I will push it to canary soon). Since https://github.com/karma-runner/karma/commit/a37fd6f7d28036b8da5fe98634cf711cebafc1ff the config is a regular node module, similar syntax to Grunt. And you can add any custom config properties.

V.
Reply all
Reply to author
Forward
0 new messages