"grunt test" isn't working
Hi guys,
I'm trying to develop some new features on SIP.js using TDD, but I'm failing to run the unit tests.
When I run:
$ grunt test --verbose
This is what I get:
Initializing
Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Registering "grunt-browserify" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-browserify/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-browserify/package.json...OK
Loading "browserify.js" tasks...OK
+ browserify
Registering "grunt-contrib-copy" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-copy/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-contrib-copy/package.json...OK
Loading "copy.js" tasks...OK
+ copy
Registering "grunt-contrib-uglify" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-uglify/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-contrib-uglify/package.json...OK
Loading "uglify.js" tasks...OK
+ uglify
Registering "grunt-contrib-jshint" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jshint/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jshint/package.json...OK
Loading "jshint.js" tasks...OK
+ jshint
Registering "grunt-contrib-jasmine" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jasmine/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jasmine/package.json...OK
Loading "jasmine.js" tasks...OK
+ jasmine
Registering "grunt-peg" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-peg/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-peg/package.json...OK
Loading "peg.js" tasks...OK
+ peg
Registering "grunt-trimtrailingspaces" local Npm module tasks.
Reading /home/bagostini/research/SIP.js/node_modules/grunt-trimtrailingspaces/package.json...OK
Parsing /home/bagostini/research/SIP.js/node_modules/grunt-trimtrailingspaces/package.json...OK
Loading "trimtrailingspaces.js" tasks...OK
+ trimtrailingspaces
Loading "Gruntfile.js" tasks...OK
+ build, default, devel, grammar, quick, test, travis
Running tasks: test
Running "test" task
Running "jasmine" task
Running "jasmine:components" (jasmine) task
Verifying property jasmine.components exists in config...OK
Files: dist/sip-0.7.5.js
Options: version="2.0.1", timeout=10000, styles=[], specs="test/spec/*.js", helpers="test/helpers/*.js", vendor="test/polyfills/*.js", polyfills=[], outfile="_SpecRunner.html", host="", template="/home/bagostini/research/SIP.js/node_modules/grunt-contrib-jasmine/tasks/jasmine/templates/DefaultRunner.tmpl", templateOptions={}, junit={}, ignoreEmpty=false, display="full", summary=false, keepRunner=false
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jasmine/tasks/jasmine/reporters/PhantomReporter.js...OK
Writing .grunt/grunt-contrib-jasmine/reporter.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/lib/jasmine-core/jasmine.css...OK
Writing .grunt/grunt-contrib-jasmine/jasmine.css...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/lib/jasmine-core/jasmine.js...OK
Writing .grunt/grunt-contrib-jasmine/jasmine.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js...OK
Writing .grunt/grunt-contrib-jasmine/jasmine-html.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/lib/jasmine-core/json2.js...OK
Writing .grunt/grunt-contrib-jasmine/json2.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/lib/jasmine-core/boot.js...OK
Writing .grunt/grunt-contrib-jasmine/boot.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/jasmine-core/images/jasmine_favicon.png...OK
Writing .grunt/grunt-contrib-jasmine/jasmine_favicon.png...OK
Reading /home/bagostini/research/SIP.js/node_modules/es5-shim/es5-shim.js...OK
Writing .grunt/grunt-contrib-jasmine/es5-shim.js...OK
Reading /home/bagostini/research/SIP.js/node_modules/grunt-contrib-jasmine/tasks/jasmine/templates/DefaultRunner.tmpl...OK
Processing source...OK
Writing _SpecRunner.html...OK
Testing jasmine specs via phantom
At this point, test remains stuck forever.
Any ideas of what I'm doing wrong? :/
Additional Details
- I followed the description from file BUILDING.md.
- Installed jasmine, grunt, phantomjs globally, and all the another dependencies using
$ npm install. - Node version is v4.2.6.
- Npm version is 3.5.2.
- I'm using Ubuntu 16.04 LTS.
$ grunt develworks, but doesn't generate the file sip-devel.js, as specified by the doc.- I've create the file sip-devel.js copying it from sip-0.7.5.js, as required by the doc. No success.
- I have also tried to run the tests manually using
$ jasmine, but got no success as well.
Hi Bruno,
Can you try running open _SpecRunner.html? I am not able to recreate your issue, but the problem seems to be with phantom.
James
Hi James! Thanks for the attention. =]
I ran google-chrome _SpecRunner.html and got this (logged in the browser):
http://pastebin.com/Q8UNavf3
Additional Details
The first time I installed phantomjs, I had used the command $ sudo apt-get install -y phantomjs.
This was the result:
[14:25:21] bagostini@bagostini-OptiPlex-7010:~/research/SIP.js $ grunt test
Running "jasmine:components" (jasmine) task
Testing jasmine specs via PhantomJS
Fatal error: spawn /usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs ENOENT
After that, I downloaded the tar properly copying the binary to that location. In this scenario, tests got stuck.
I also tried to install it using $ sudo npm install -g phantomjs. Tests got stuck as well.
I've also tested it on a Debian GNU/Linux 8.5 (jessie), just in case, and got the same results.