javascript - Karma Test: PhantomJS: ReferenceError: Can't find variable: Pusher -
i'm writing unit tests, in angularjs controller i'm using pusher asynchronous connections.
var driverctrl, scope; var $httpbackend = {}; beforeeach(inject(function ($controller, $rootscope, _$httpbackend_, _driverservice_, _pusherservice_, _authservice_) { scope = $rootscope.$new(); driverctrl = $controller('driverctrl', { $scope: scope, driverservice: _driverservice_, pusherservice: _pusherservice_, authservice: _authservice_ }); $httpbackend = _$httpbackend_; })); aftereach(function () { $httpbackend.verifynooutstandingexpectation(); $httpbackend.verifynooutstandingrequest(); });
first getting following exception after going through pusher documentation, made changes karma.conf.js , bower.json
phantomjs 1.9.8 (linux) driverctrl should connected driver view failed referenceerror: can't find variable: pusher
karma.conf.js, i've added line
'bower_components/angular-scenario/angular-scenario.js'
and bower.json. i've section
"devdependencies": { "angular-mocks": "~1.2.0", "angular-scenario": "~1.2.0", "pusher-test-stub": "*" }
now i'm getting following error
warn [watcher]: pattern "/home/machine/rubyprojects/taxiteam4/taxihome-frontend/test/mock/**/*.js" not match file. info [phantomjs 1.9.8 (linux)]: connected on socket imixylqv7jw3qexo0w5c id 33183997 phantomjs 1.9.8 (linux): executed 0 of 0 error (0.001 secs / 0 secs) warning: task "karma:unit" failed. use --force continue.
i've tried changing ports in karma.conf.js didn't help
Comments
Post a Comment