-
Notifications
You must be signed in to change notification settings - Fork 8
Move main logic from bin file #9
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a little awkward:
import tapDifflet from 'tap-difflet';
const reporter = tapDifflet({
'--pessimistic': true,
});
More likely we'd probably want to do something like this:
import tapDifflet from 'tap-difflet';
const reporter = tapDifflet({
pessimistic: true,
});
With that change to the API and some documentation of the API in the README
I'd love to merge this. 👍 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Just two more minor changes and I'll get this merged and push it to a new version. 🚀
It also can be used inside node code | ||
|
||
~~~ text | ||
import tapDifflet from 'tap-difflet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used ES6 stuff in my example before, but we should probably use node-friendly syntax here instead:
var tapDifflet = require('tap-difflet');
var formatter = tapDifflet({
pessimistic: true // Only output failed tests. `false` by default.
});
I also added a small comment to clarify the usage inline.
@@ -191,5 +191,7 @@ module.exports = function (options) { | |||
|
|||
}); | |||
|
|||
dup.errors = errors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this isn't officially part of the API, let's change this to dup.__errors = errors
(and reflect the name change in the CLI code, too).
@@ -23,10 +23,10 @@ Options: | |||
It also can be used inside node code | |||
|
|||
~~~ text | |||
import tapDifflet from 'tap-difflet'; | |||
var tapDifflet = require('tap-difflet'); | |||
|
|||
const formatter = tapDifflet({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Teeny change: Let's use var
here for consistency. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks for the contribution!
Your code is now in 0.7.0 and can be installed via npm. 👍 Thanks again! |
Thank you too for your fast replies and advices about code improvement👍 |
I want to use this plugin with https://github.com/infernalmaster/karma-tap-pretty-reporter. So I did some code separation (just like https://github.com/substack/faucet is made)