Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Set reporter programmatically #17

Open
0x1mason opened this issue Sep 27, 2016 · 7 comments
Open

Set reporter programmatically #17

0x1mason opened this issue Sep 27, 2016 · 7 comments

Comments

@0x1mason
Copy link

Possible via options?

@0x1mason
Copy link
Author

Custom reporter, e.g. tap-nyan.

@sindresorhus
Copy link
Member

From the readme:

Adheres to AVA options in package.json. You can also specify options in the plugin as seen above.

@0x1mason
Copy link
Author

@sindresorhus Thanks for the quick response. I read the docs and see the options. I do not see an option for reporters. Does that mean there isn't one?

@0x1mason
Copy link
Author

The docs only mention piping to custom reporters via the the cli which is why I'm inquiring here. Is there a gulp specific workaround?

@sindresorhus
Copy link
Member

Yeah, you're right. Not that clear. AVA doesn't support third-party reporters directly, but instead comes with a TAP option, enabling you to use any TAP reporter. See the "tap": true, option. Although, thinking about it more, the Gulp output might conflict with the TAP output, so I'm not 100% sure it will work correctly. I think TAP is supposed to ignore non-TAP output, but needs to be confirmed.

That being said. Would honestly be easier to just spawn the ava binary directly from Gulp.

@sindresorhus sindresorhus reopened this Sep 28, 2016
@0x1mason
Copy link
Author

Cool, thanks. Yeah, I'll try spawning or hacking the plugin.

@sindresorhus
Copy link
Member

Not tested, but with execa it could probably be as simple as:

gulp.task('test', () => execa.shell('ava --tap | tap-nyan', {stdio: 'inherit'}));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants