angularjs - Angular js testing with Grunt -


i having problem running test in angularjs project -when run "grunt test" referenceerror: io not defined running server localy throug port 3000 wich node.js socket.io server , impliment in index.html

<script src="http://localhost:3000/socket.io/socket.io.js"></script> 

this function testing:

$scope.editproject = function (dat) {       $http({         method: 'put',         url: 'http://some.net/api/project/' + $routeparams.id,         data: angular.tojson(dat),         headers: {'content-type': 'application/json'}       })       .success(function(d) {         var time = $filter('date')(new date(), 'dd/mm hh:mm:ss');         var loc = '/project/' + $routeparams.id;         var head = {           user : $rootscope.userinfo.username,           message: 'some message ',           name : dat.projectname,           url: loc,           date: time,           icon : 'icon-th-list'         };         socket.emit('updateheader', head );         $location.url('/project/' + $routeparams.id);       });     }; 

install last yeoman on project , solve problem. install grunt , bower automatically. after, can install socket.io client bower.

grunt test                        # test app grunt server                      # preview app grunt                             # build application deployment 

use bower component more package.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -