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

Get default options from test/mocha.opts #44

Closed
ai opened this issue Jul 8, 2014 · 11 comments
Closed

Get default options from test/mocha.opts #44

ai opened this issue Jul 8, 2014 · 11 comments

Comments

@ai
Copy link
Contributor

ai commented Jul 8, 2014

By default Mocha gets default options from test/mocha.opts. This plugin should did it too.

If I need to run only one test, I will execute mocha test/wrong.js. But in Travis CI gulp plugin is better. I want to combine this two runner methods, but I need common place to put options,

@ai
Copy link
Contributor Author

ai commented Jul 8, 2014

@sindresorhus is it even good idea to use Gulp in Travis CI? Does Gulp with gulp-mocha returns 1 on errors?

@sindresorhus
Copy link
Owner

is it even good idea to use Gulp in Travis CI?

It's just as easy to just run it from npm test:

"test": "mocha"

Does Gulp with gulp-mocha returns 1 on errors?

Yes.

@ai
Copy link
Contributor Author

ai commented Jul 9, 2014

@sindresorhus My Gulp task is:

gulp.task('test', function () {
    require('./');
    var mocha = require('gulp-mocha');

    return gulp.src('test/*.js', { read: false })
        .pipe(mocha());
});

But, when I run gulp test with issues in specs, Gulp show broken test, but exit with 0: https://travis-ci.org/ai/postcss/builds/29471330

I updated gulp-mocha to 0.5, but result is same :(.

@ai
Copy link
Contributor Author

ai commented Jul 9, 2014

@sindresorhus I create separated issue about exit code: #45

@ilanbiala
Copy link

@ai you can close this and the conversation for #45 will continue there.

@ai
Copy link
Contributor Author

ai commented Sep 9, 2014

@ilanbiala but what about test/mocha.opts? :)

@floatdrop
Copy link
Contributor

@ai you should create issue about it in mocha - because code, that parsing mocha.opts file is there. May be it worth it to extract this code to separate package which will be used in gulp-mocha and mocha itself.

@morficus
Copy link

_bump_

any word on having this plugin grab the default options from test/mocha.opts? or @floatdrop , could you elaborate on your last comment from above?
it seems like the original intent of this issue got lost with the side conversation :-)

@thom-nic
Copy link

I was looking for this too. Unfortunately parsing test/mocha.opts is not part of mocha's official API. The relevant code is in mochajs/mocha/blob/master/bin/options.js. Furthermore, it doesn't actually return the parsed options as an object. Instead it sets process.argv :(

So unfortunately I have to agree, mocha should fix this...

@bemble
Copy link

bemble commented Dec 20, 2015

My pull request #119 replies to this need :)

@sindresorhus
Copy link
Owner

Should be fixed in the latest release: https://github.com/sindresorhus/gulp-mocha/releases/tag/v4.0.0

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

No branches or pull requests

7 participants