-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Spawn Mocha instead of using its API #151
Conversation
+1 we are having the same problems and it seems this will fix it |
Good start. Thanks for working on this 🎉 Can you make sure the options in the readme matches the CLI flags (in a camelCased version)?
Should be changed back. Use EditorConfig and |
.gitignore
Outdated
@@ -1 +1,2 @@ | |||
node_modules | |||
*-backup.* |
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 should be in your own local gitignore.
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.
aye
.travis.yml
Outdated
- '0.10' | ||
- 4 | ||
- 6 | ||
- 7 |
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.
These needs to be quoted
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.
curious. none of my other projects have these quoted and travis works as expected. please do share why
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.
YAML interprets them as number, but versions are not number in this sense. They should be quoted for consistency. It's only a quirk that they work now.
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.
good to know, thanks
index.js
Outdated
if (options.suppress) { | ||
suppress = true; | ||
delete options.suppress; | ||
} |
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.
Instead of this, just use the excludes
option in dargs
.
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.
aye
index.js
Outdated
} | ||
} | ||
} | ||
options = Object.assign({colors: true}, options || {}); |
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.
options || {}
=> options
Object.assign handles it.
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.
good to know. old school habits persist hard :)
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "gulp-mocha", | |||
"version": "3.0.1", | |||
"version": "4.0.0", |
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.
Don't bump this. We'll do it at publish time.
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.
cool. will revert
package.json
Outdated
@@ -10,7 +10,7 @@ | |||
"url": "sindresorhus.com" | |||
}, | |||
"engines": { | |||
"node": ">=0.10.0" | |||
"node": ">=4.6.2" |
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.
"node": ">=4"
package.json
Outdated
}, | ||
"devDependencies": { | ||
"mocha": "^3.0.0", |
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.
mocha
should be a dependency
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.
ah. I had thought the ecosystem was moving towards the pattern that gulp-jshint is using now; where jshint is a peerDep. Will remedy.
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.
Peerdependencies are annoying for everyone, now that npm@3 dedupes by default, the user can just add mocha
to their own package.json with a more specific version and it will be deduped to that version and we'll use it too as long as it's in the v3 range.
requested changes made. I manually verified the command line options from camelCase. didn't see a need to add that to tests as |
process.stdout.write(result.stdout); | ||
} | ||
|
||
this.emit('result', result); |
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 needs to be documented.
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.
was only meant to be used internally for tests
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.
Then it should be prefixed with an underscore: _result
|
||
options = Object.assign(defaults, options); | ||
|
||
if (Object.prototype.toString.call(options.globals) === '[object Array]') { |
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.
Use Array.isArray()
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.
that's not compatible with with node < 6. http://node.green/#Array-isArray-support
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.
Yes, it is. You're looking at proxy support. Array.isArray()
has been available since at least Node.js 0.10.
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.
Yep, my fault there.
@@ -42,6 +42,10 @@ gulp.task('default', () => | |||
|
|||
#### options | |||
|
|||
gulp-mocha will pass any options defined directly to the `mocha` binary. That | |||
means you have every [command line option](http://mochajs.org/#usage) available |
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.
Needs to be explicit about it users using a camelCased version of those command line options.
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.
dargs doesn't require that you use only camelCased args, it treats the arguments the same if they're in sausage case (the format of the mocha args) as well.
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.
That's not the point. Users don't want to use quotes in the keys. And they wouldn't even know camelCase is supported.
I'm going to leave this to someone else to touch up the finer, stylistic comments on this PR. The high standards you hold this to are admirable, but just a tad on the nitpicky side of the line for my tastes. The turn-around time on review for the stylistic change requests has been a bit long as well. And that's said completely devoid of any amount of sarcasm, snide, ill-will, or negativity. I'm extremely grateful for your time and massive contribution to the node ecosystem. |
@shellscape I did a thorough review because I thought you wanted to learn. It would have indeed been much much faster for me to just fix everything after merging. You shouldn't expect maintainers to clean up your mess though. Pull requests reviews are meant to get the code into an acceptable state before being merged into master. Once it's in master, it's the maintainers job to maintain it, so obviously they want it to be good before it ends up there. I appreciate the pull request though :) |
I appreciate the sentiment. While I'm always expanding what I know, I consider myself to be a seasoned developer (your opinion may vary, and that's OK). This wasn't a learning exercise for me, so to speak. I was interested in coming on as a maintainer, which is why I contacted and spoke about what direction the code needed to go in, rather than releasing a different module. And in that role (a maintainer) I would have been very comfortable with the PR as it was this morning. That moves to highlight our differences, which is OK. If you're ever to the point where you're good letting go of the reigns, give me a shout. |
this PR fixes #20 and provides resolution to most of the other remaining issues.
notes:
error
andresult
events.result
events provides for testing the command result without having to override output methods.this is a first-pass, and welcoming comments.