gruntjs/grunt-contrib-jasmine

grunt-contrib-jasmine does not always search the right folder for es5-shim

trevj opened this issue · 5 comments

trevj commented

How does grunt-contrib-jasmine find es5-shim.js?

When my package.json lists es5-shim as a dependency, I see the following error:

Running "jasmine:test" (jasmine) task
Verifying property jasmine.test exists in config...OK
Files: build/arraybuffers/arraybuffers.js
Options: version="2.0.1", timeout=10000, styles=[], specs="build/arraybuffers/arraybuffers.spec.js", helpers=[], vendor=[], polyfills=[], outfile="_SpecRunner.html", host="", template="/usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/tasks/jasmine/templates/DefaultRunner.tmpl", templateOptions={}, junit={}, ignoreEmpty=false, display="full", summary=false
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/tasks/lib/../jasmine/reporters/PhantomReporter.js...OK
Writing .grunt/grunt-contrib-jasmine/reporter.js...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.css...OK
Writing .grunt/grunt-contrib-jasmine/jasmine.css...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js...OK
Writing .grunt/grunt-contrib-jasmine/jasmine.js...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js...OK
Writing .grunt/grunt-contrib-jasmine/jasmine-html.js...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/lib/jasmine-core/json2.js...OK
Writing .grunt/grunt-contrib-jasmine/json2.js...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/lib/jasmine-core/boot.js...OK
Writing .grunt/grunt-contrib-jasmine/boot.js...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/node_modules/jasmine-core/images/jasmine_favicon.png...OK
Writing .grunt/grunt-contrib-jasmine/jasmine_favicon.png...OK
Reading /usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/tasks/lib/../../node_modules/es5-shim/es5-shim.js...ERROR
Warning: Unable to read "/usr/local/google/home/trevj/src/xxx/node_modules/grunt-contrib-jasmine/tasks/lib/../../node_modules/es5-shim/es5-shim.js" file (Error code: ENOENT). Use --force to continue.

Aborted due to warnings.

es5-shim.js is in my node_modules/ but, presumably because I've listed it in package.json as a dependency, it's under node_modules/es5-shim rather than in grunt-contrib-jasmine's own node_modules/.

Can you try with the latest master?

I'm having a similar issue with grunt-contrib-jasmine 0.9.1 and npm 3.x.x. Running the tests I get this error:

Warning: Unable to read "/Users/me/Git/web-disney/web-platform/node_modules/grunt-contrib-jasmine/node_modules/es5-shim/es5-shim.js" file (Error code: ENOENT). Use --force to continue.

I have to manually copy /node_modules/es5-shim/ into /node_modules/grunt-contrib-jasmine-node_modules/es5-shim to fix the issue.

I can reproduce on 0.9.1 but it seems to be fixed as of 0.9.2

edit: using npm 3.3.4

I ran into the same issue with npm 3.3.9 and grunt-contrib-jasmine 0.8.2. Fixed with 0.9.2.

I did what @globexdesigns said and it worked.

npm 3.8.0
node v4.3.1
grunt-cli v0.1.13
grunt v0.4.5
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-jasmine": "^^1.0.0"
  },

On Windows 10 x64