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

gulp-mocha no longer works with many files #165

Open
rogierschouten opened this Issue Mar 8, 2017 · 4 comments

Comments

5 participants
@rogierschouten

rogierschouten commented Mar 8, 2017

On Windows, running gulp-mocha with lots of .js files results in a command line too long error:

Error in plugin 'gulp-mocha'
Message:
    spawn undefined ENOENT
Details:
    errno: ENOENT
    code: ENOENT
    syscall: spawn undefined
    killed: false
    stdout:
    stderr: The command line is too long.

    failed: true
    signal: null
   cmd: mocha  <MANY_JS_FILES_LISTED_HERE> --colors
    timedOut: false
    domainEmitter: [object Object]
    domain: [object Object]
    domainThrown: false

This is specific to v4. Downgrading to gulp-mocha version 3.0.1 removes this error.

@leifdejong

This comment has been minimized.

Show comment
Hide comment
@leifdejong

leifdejong Mar 15, 2017

On Mac too.

Message:
    Command failed: mocha <path to spec> --colors
   stderr: 
    failed: true
    signal: null
    cmd: mocha <path to spec> --colors
    timedOut: false

leifdejong commented Mar 15, 2017

On Mac too.

Message:
    Command failed: mocha <path to spec> --colors
   stderr: 
    failed: true
    signal: null
    cmd: mocha <path to spec> --colors
    timedOut: false
@jezzsantos

This comment has been minimized.

Show comment
Hide comment
@jezzsantos

jezzsantos Apr 16, 2017

On Windows 10, get same problem.
Changing to support long paths in windows, as described here: #154 (comment) did not fix it.

Reverting back to 3.0.1 fixed it.
Version 4.0.0 broke it again!

jezzsantos commented Apr 16, 2017

On Windows 10, get same problem.
Changing to support long paths in windows, as described here: #154 (comment) did not fix it.

Reverting back to 3.0.1 fixed it.
Version 4.0.0 broke it again!

gingur added a commit to gingur/godaddy-test-tools that referenced this issue Jul 19, 2017

samshull added a commit to godaddy/godaddy-test-tools that referenced this issue Jul 19, 2017

@lgodmer

This comment has been minimized.

Show comment
Hide comment
@lgodmer

lgodmer Apr 26, 2018

Unfortunately gulp-mocha version 3.0.1 depends on mocha version 3.0.0, which depends on growl 1.9.2 - which has a security vulnerability (tj/node-growl#60)
So downgrading is not an option if you are using a tool to scan your node_modules tree for known vulnerabilities.
The issue is still present in gulp-mocha 5.0.0

lgodmer commented Apr 26, 2018

Unfortunately gulp-mocha version 3.0.1 depends on mocha version 3.0.0, which depends on growl 1.9.2 - which has a security vulnerability (tj/node-growl#60)
So downgrading is not an option if you are using a tool to scan your node_modules tree for known vulnerabilities.
The issue is still present in gulp-mocha 5.0.0

@nayan92

This comment has been minimized.

Show comment
Hide comment
@nayan92

nayan92 Jun 22, 2018

I've been having trouble with this on Windows 10 too. The solution/workaround I've used is to pass the directory containing the tests to mocha rather than all the files. Mocha will then run all the tests in that directory. If you also use the recursive flag, then mocha will look for tests in subdirectories too.

An example:

var gulp = require('gulp');
var mocha = require('gulp-mocha');

gulp.task('run-tests', function() {
    return gulp.src([ /path/to/directory/ ], { read: false })
        .pipe(mocha({
            recursive: true
        }));
})

nayan92 commented Jun 22, 2018

I've been having trouble with this on Windows 10 too. The solution/workaround I've used is to pass the directory containing the tests to mocha rather than all the files. Mocha will then run all the tests in that directory. If you also use the recursive flag, then mocha will look for tests in subdirectories too.

An example:

var gulp = require('gulp');
var mocha = require('gulp-mocha');

gulp.task('run-tests', function() {
    return gulp.src([ /path/to/directory/ ], { read: false })
        .pipe(mocha({
            recursive: true
        }));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment