Open dsernst opened 9 years ago
aaa.js
is just a simple file to get something to work, to rule out the case that the complexity of the existing tests was leading to a problem. Here's what it looks like:
describe('something', function () {
it('works', function () {
});
});
And the .pipe(gulp.dest('aaaa'))
bit does a simple copy to rule out the possibility that there is a typo in the path to the file, or that the file is missing.
The task does successfully copy aaa.js
to that destination folder, ruling out the possibility that the file isn't there — like ENOENT
would usually suggest.
Ah! Figured something out!
I wanted to run this module's own tests to see if anything was working. So I went into its folder, and tried to run its gulp test
:
spawn-mocha-parallel dsernst$ gulp test
module.js:338
throw err;
^
Error: Cannot find module 'q'
so I did an npm install
from within that folder.
After doing that, running its own gulp test
worked and it passed all its own tests. Then, switching back to my projects root, and trying to gulp mocha-test
task again, it worked this time!
So it would seem this package has some sort of dependency problem, and it's silently failing because of it.
@dsernst When using this module if you ever come across failures/errors try running the same tests with just mocha. In a couple scenarios using spawn-mocha-parallel wouldn't output good information about what the error/failure was about. Running the test with mocha itself usually gives me what I need for debugging.
Is there a reason why "q" isn't installed immediately? I had this same problem...
The problem is not with this modules dependencies but that by default it is looking inside this modules node_modules dir for the mocha dependency rather than in the higher level one. I suspect this will have worked with npm 2 but now with npm 3 the sub dependencies are flat and mocha can't be found where this module is looking for it.
In order to work around this you can use the undocumented 'bin' param that allows you to change the default location of mocha.
e.g. adapting the readme example and assuming a project layout of --node_modules --gulp.js
In the gulp.js:
var path = require('path');
var mochaStream = require('spawn-mocha-parallel').mochaStream;
var mocha = mochaStream({
concurrency: 10,
bin: path.join(__dirname, 'node_modules', '.bin', 'mocha')
});
gulp.task('test-mocha', function() {
return gulp.src('**/*-specs.js', {read: false})
.pipe(mocha)
.on('error', console.error)
});
I can't get this module to work. Every time I try to run the gulp task I get this error in my console:
Here's the code trying to run it:
Do you have any idea why it is throwing back this
ENOENT
every time?