Questions tagged [karma-mocha]

karma-mocha is a Karma plugin. Adapter for Mocha testing framework.

karma-mocha is A Karma plugin. Adapter for Mocha testing framework.

325 questions
0
votes
1 answer

karma-coverage files not created while singleRun = true

I am using Karma to run my unit tests and am now trying to incorporate karma-coverage into my process. I am using PhantomJS to run the tests with singleRun: true. Whenever I do this, my code coverage reporter does not seem to be running. If I set…
gwin003
  • 7,432
  • 5
  • 38
  • 59
0
votes
1 answer

Karma: ReferenceError: app is not defined

I followed the tutorial from http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html for testing AngularJS apps with Karma. My karma.conf.js looks like this: module.exports = function(config) { config.set({ …
ssuljic
  • 1,081
  • 1
  • 9
  • 26
0
votes
0 answers

Karma test fails in Firefox with strange error

I've got a very odd behavior with one of my tests. It runs successfully in Chrome, but always fails in Firefox. It tests a directive and error occurs in beforeEach block. TypeError: menu is null (path/to/file.js:6) //This points to a block of…
Eugene Kostrikov
  • 6,799
  • 6
  • 23
  • 25
0
votes
0 answers

Unit testing services with mocha (no e2e test) on AngularJS with $timeout never finishes

I have a service that needs to call the database through AJAX and this is the test for it: describe 'Cep service', -> cep = undefined $timeout = undefined beforeEach(module('cep')) beforeEach(inject(($cep, $injector)-> cep = $cep …
pocesar
  • 6,860
  • 6
  • 56
  • 88
-1
votes
1 answer

Vue unit test error: expected [Function: proxy] to be false

Vue unit test error: expected [Function: proxy] to be false The function in the Vue component is: data(){ return{ showcart:false } } methods:{ closedialoguebox: function() { return (this.showcart = false); } } and the…
-1
votes
1 answer

beforeEach fails in karma + Mocha with angular 4 upgrade

Context I have confirmed "green" builds on the master branch which is using angular-cli 1.0.0 and the old angular2 dependencies. My Objective is to upgrade from angular2 to angular4. Post upgrade issue The application works The unit tests fail in…
Arran Bartish
  • 135
  • 1
  • 12
-1
votes
1 answer

Unit testing angular.js service (node.js server) in controller

I'm new to the unit testing in the client side. My application uses the express.js, angularjs-ui-router and node.js. Currently i start writing the unit test cases for the application. I'm using Karma, Mocha, Chai, Sinon for unit testing. My router…
Miko
  • 2,615
  • 9
  • 33
  • 58
-1
votes
2 answers

undefined is not an object in Angular.js service

I have a method like this in my service angular.module('App') .factory("AppService", [function() { var _admin; return { get admin() { return _admin; }, }; }]); In my controller i am using it like this:…
Shane
  • 5,517
  • 15
  • 49
  • 79
-1
votes
1 answer

webpack- peer dependency versioning mismatch issue?

While installing npm packages I am getting peer dependencies versioning mismatch issue. Error - npm ERR! peerinvalid The package webpack@2.1.0-beta.12 does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer…
Samir
  • 691
  • 5
  • 22
-1
votes
2 answers

Testing $scope variables in angularjs

I have a piece of angular code like below: $scope.someFunction = function(){ $scope.val = $scope.value2.length; } I would like to test the above piece of code, for which i am doing something like below: describe('test that', function() { …
Shane
  • 5,517
  • 15
  • 49
  • 79
1 2 3
21
22