vistaprint / grunt-js-test

Grunt plugin to run client-side, mocha unit tests and generate code coverage reports
10 stars 11 forks source link

Fails as a sub-dependency #26

Closed franciscop closed 3 years ago

franciscop commented 7 years ago

I think the problem is in line 17 of grunt-js-test/tasks/js-test.js:

grunt.loadTasks(path.join(__dirname, '../node_modules/grunt-mocha/tasks'));

This is probably due to breaking changes in NPM 3.0.0:

Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting.

And this is the error message, failing on npm test for the project Chance.js:

> chance@1.0.4 test [...]/chancejs
> grunt test-ci

>> Tasks directory "[...]/chancejs/node_modules/grunt-js-test/node_modules/grunt-mocha/tasks" not found.

Running "jshint:all" (jshint) task
>> 16 files lint free.

Running "js-test" task
>> Started proxy web server on port 8983.

I tried to access that folder manually and it doesn't exist (there's no grunt-mocha inside grunt-js-test/node_modules). This is the actual structure I'm getting when installing it by default:

/chancejs
  /node_modules
    ...
    /grunt-mocha
    /grunt-js-test
      /node_modules
        [NO grunt-mocha here]

I see that Chance.js got the same problem in Travis CI and solved it, waiting for his input on this issue.