Questions tagged [karma-runner]

Karma provides developers a testing environment where they don't have to set up many things, rather just write code and get instant feedback in order to improve productivity and creativity.

karma-runner
Filter by
Sorted by
Tagged with
11 votes
2 answers
13k views

Does Karma support source map files?

Is it possible to configure Karma to use source map files for stacktraces? I see that there are a few issues on GitHub which appear to have been closed? I can't however find any example of doing so. ...
cirrus's user avatar
  • 5,652
4 votes
2 answers
708 views

AngularJS and Karma, Cannot call method 'module' of undefined

I start karma inside an AngularJs yeoman scaffolding. The error "Cannot call method 'module' of undefined" is in gruntfile.js, generated by yeoman, on the first line module.exports = function (grunt) {...
Tres's user avatar
  • 571
2 votes
1 answer
635 views

Karma for automatic user interaction testing?

I'm testing a setup with Karma + Mocha. One of the things this might (?) do is testing user-interaction on a variety of browsers including PhantomJS (headless webkit). I say might because I'm not ...
Geert-Jan's user avatar
  • 18.8k
0 votes
2 answers
1k views

Instanbul Keeps Dumping Coverage Report HTML files in wrong directory

Here's my config file: module.exports = function(config) { config.set({ basePath: './', autoWatch: true, frameworks: ['jasmine'], files: [ '../...
Levi Hackwith's user avatar
1 vote
2 answers
754 views

Karma watch on specific file

I have a karma.conf.js like this: module.exports = function(config){ config.set({ files : [ 'static_dev/js/lib/underscore-min.js', 'static_dev/js/lib/angular.1.2.9.min.js', ...
Jon Snow's user avatar
  • 3,712
15 votes
1 answer
5k views

Using importsScripts within Blob in a karma environment

I am working on a small project of mine using karma, and jasmine. My targeted browser is chrome 32. I am trying to import scripts within a web worker whom I have instanciated through a blob as ...
Arthis's user avatar
  • 2,293
0 votes
1 answer
3k views

AngularJS, jasmine unit test throws 'Unknown provider' error

I'm trying to write a simple unit test for a controller in my app, but Jasmine is throwing an 'Unknown provider' error. It's choking on a provider that I wrote to help with retrieving template urls. ...
Matt Messinger's user avatar
1 vote
1 answer
2k views

Angular karma test: TypeError readonly property

I'm trying to mock out this 'usermanager' provider in my controller test and I always end up getting this error TypeError: Attempted to assign to readonly property. at workFn (c:{...}/...
Bjarki's user avatar
  • 221
3 votes
1 answer
957 views

Getting Karma/Jasmine working for AngularJS project

UPDATE: I've resolved the problem. I had mistyped the filename for a dependency int karma config's files list. Very frustrating that I had to modify core angular files to log out this information ...
Zach Lysobey's user avatar
  • 15.2k
5 votes
2 answers
3k views

Run Grunt silent / not verbose

How to run Grunt more silent? I don't have the --verbose option on. Still I get a long log. I would like to have a shorter log, ideally just log the failed specs. Any suggestion? I am using grunt-...
Rikard's user avatar
  • 7,645
1 vote
1 answer
851 views

Cannot run unit tests on angular-seed

I followed the instructions on Running Unit Tests on the Angular Seed Project, but I get the following error: scripts/test.sh: line 9: scripts/../node_modules/karma/bin/karma: No such file or ...
raviolicode's user avatar
  • 2,165
3 votes
5 answers
1k views

Typescript code coverage of multiple __extends declarations

When it compiles my code, TypeScript includes an __extends declaration at the top of every file: var __extends = this.__extends || function (d, b) { /* istanbul ignore next */ for (var p in b)...
stolli's user avatar
  • 5,776
0 votes
2 answers
224 views

Sinon TypeError: '[object ProgressEventConstructor]' in Karma/SauceLabs testing

I'm migrating a framework Specs to run with Karma/Jasmin/Grunt and Travis/SauceLabs While running the specs I get errors in all Ajax specs for some browsers. PhantomJS/Opera/Chrome && FF are ...
Sergio's user avatar
  • 28.7k
194 votes
10 answers
73k views

NPM cannot install dependencies - Attempt to unlock something which hasn't been locked

I've been trying to run an npm install on my package.json file, but I'm having a lot of trouble. It keeps saying "Error: Attempt to unlock XXX, which hasn't been locked" on all my dependences. Here'...
TJ Kirchner's user avatar
  • 4,321
2 votes
1 answer
1k views

My karma unit tests works fine if I use Chrome in karma.conf.js but fails if changed to PhantomJS

Code segment to test: $timeout(function() { $http.get('/getUpdates.json') .success(function(data, status, headers, config) { }) .error(function(data, status, ...
mohitbansal's user avatar
1 vote
1 answer
796 views

How to de-bootstrap an angular js application in unit tests?

In my jasmine tests I test the app initialization the following way: (function () { "use strict"; describe('app', function () { beforeEach(function() { module('app'); }); it('...
arturh's user avatar
  • 6,086
1 vote
1 answer
199 views

Is it possible to run Grunt Karma locally?

Is it possible to run Grunt Karma locally? Start the Karma server, assign a port to it and then open different browsers on my computer and run tests by inserting the localhost:port? I have a Github ...
Rikard's user avatar
  • 7,645
4 votes
0 answers
967 views

Using Resharper and Karma to run Jasmine tests on Angular modules in Require modules

That's a mouthful. I feel like I'm asking for the moon, but I would like to be able to use Resharper and Karma to run my Jasmine tests for my code that defines Require modules that contain Angular ...
steve's user avatar
  • 1,109
3 votes
1 answer
1k views

How to stop the angular-translate model from loading the JSON file in a test?

My config file is: angular.module('mean').config(['$routeProvider', '$translateProvider', '$locationProvider', function($routeProvider, $translateProvider, $locationProvider) { $routeProvider. ...
Shamoon's user avatar
  • 42.3k
1 vote
1 answer
272 views

Overwrite a function of a stub

I want to test my google maps geocoder directive. There, I have a geocode constructor which I already stubbed: ... link: function(scope) { var map, geocoder, myLatLng, ...
DonJuwe's user avatar
  • 4,517
6 votes
2 answers
18k views

Jasmine unit test skipped by my Karma configuration

I am trying to run Jasmine test using Karma runner as follows: module.exports = function (config) { config.set({ // base path, that will be used to resolve files and exclude ...
balteo's user avatar
  • 24.1k
4 votes
3 answers
7k views

Issues installing Karma with NPM

Trying to install Karma with node v0.10.13 and npm 1.3.2. Tried with and without sudo. Here's the log: npm http GET https://registry.npmjs.org/karma npm http GET https://registry.npmjs.org/karma npm ...
Alex B's user avatar
  • 1,009
1 vote
1 answer
574 views

EmberJS testing with Karma - runloop error with PhantomJS but not with chrome

So I've got my lovely testing system all ready to go but i've run into a problem for running it in in my CI server: for some reason Ember Testing is complaining about the run-loop, but only while ...
real_ate's user avatar
  • 11.1k
1 vote
2 answers
2k views

Cannot load "ie" it is not registered

OK, this question is similar to the one posed here: Can not load "IE", it is not registered! error message on Karma Except I suspect that user has a problem with differentiating between ...
user1821052's user avatar
1 vote
1 answer
1k views

Clearing cookies for each test not working. Using Karma + Qunit (using Pavlov) + Ember. Running in PhantomJS/Chrome

I need to clear a login cookie before each test as previous tests might have stored the cookie. This is what I have right now, but it does not seem to get rid of cookies/credentials as requests for ...
JJJ's user avatar
  • 2,889
2 votes
1 answer
3k views

AngularJS with Karma: $controller not defined error

I'm very new to testing but thought it was a good idea to start out some testing with this project. When I run grunt karma:watch I get the error with this configuration files. I have a config file ...
petur's user avatar
  • 1,386
2 votes
0 answers
139 views

karma + closure + coverage generating reports near the script files instead of targeted folder

subj, karma + closure + coverage, have coverageReporter: { type: 'html', dir: '../coverage/' }, section, but coverage still place reports near the scripts files instead of coverage folder,...
trimeyko's user avatar
  • 139
5 votes
1 answer
4k views

Karma testing with .success() getting 'undefined' is not an object'

I'm trying to write a unit test to see if the 'getStudents()' provider function in my controller gets called if some properties are appropriately set. Notice the .success() callback: $scope.update = ...
Bjarki's user avatar
  • 221
4 votes
3 answers
5k views

Including CSS in Karma Tests using Webstorm Debugger

I am using Backbone.js and RequireJs for a single page application. When I run my karma tests, there is no css included. When debugging it is difficult to know what is going on or why something is ...
jax's user avatar
  • 38.3k
10 votes
3 answers
12k views

How to load external Json file using karma+Jasmine for angularJS testing?/

Can anyone provide me an example in PLUNKER that how to load JSON file for karma/jasmine test.I want to read the data from JSON file for the test cases i am writing.I have been searching but nowhere ...
user2573410's user avatar
5 votes
2 answers
11k views

javascript code coverage in Sonar

I am kinda newbie in using Sonar and plugins for javascript code coverage. Which are the possibilities to find out the quality (including code coverage) of javascript code when analyzed with Sonar? ...
csg's user avatar
  • 2,087
3 votes
1 answer
267 views

Finding the real source of an exception thrown in angular.mock.exceptionHandlerProvider

I'm trying to contribute to angularjs, and I've made a mistake somewhere. In the console output of the karma unit tests, I see the following: Uncaught TypeError: Object #<Object> has no ...
bigblind's user avatar
  • 12.7k
15 votes
4 answers
3k views

start minimized browser instance with Karma

Everytime I start karma with for testing, a new instance of browser is opened (Firefox in my case). This is annoying because it pops out over the other windows (I am using windows 8). Is there any ...
csg's user avatar
  • 2,087
1 vote
1 answer
1k views

Karma Autowatch not working

Hi I have the following configuration and simple test, I run karma by typing 'karma start' . It runs and passes successfully, however, when I edit and save the simpletest.js file nothing happens... ...
Mantisimo's user avatar
  • 4,243
0 votes
1 answer
557 views

code coverage report for multiple browsers in Karma

How to create code coverage reports for all browsers present in Karma configuration file? My config.js looks like module.exports = function (config) { config.set({ frameworks: ['jasmine'], ...
Andrew's user avatar
  • 2,158
1 vote
0 answers
605 views

Simulate character entry in Karma

I have a jQuery plugin that limits character entry with an input element. This plugin (similar to numeric) hooks into keydown and keyup to allow certain characters prevent the event under certain ...
sennett's user avatar
  • 8,234
5 votes
2 answers
955 views

What should i test in AngularJS? [closed]

Nowadays, specially in the angularjs testing world, there are a lot of guides for made different kind of test, like Unit-testing, Midway Testing and E2E Testing, where you can learn how to made those ...
Jorge Guerola's user avatar
1 vote
1 answer
141 views

How to add a new plugin in karma's configuration file

I wanted to generate an HTML test report from karma, so I used the plugin karma-htmlfile-reporter. I followed the instruction of that plugin. However, the setting below tripped me over: plugins : [ ...
JBT's user avatar
  • 8,656
0 votes
2 answers
3k views

Tried to add requirejs to my karma tests, and now getting "script error for: jasmine-jquery"

I had a working implementation of karma-based tests without requirejs, and I decided I should add requirejs to it before it got too large. I'm not sure what I did, but I'm now getting an error ...
David M. Karr's user avatar
4 votes
0 answers
1k views

Generating html spec runner using karma

I'm considering moving from grunt-contrib-jasmine to karma to run my jasmine tests. One thing I can't see how to replicate in karma is saving a html spec runner which I can then manually open in the ...
wheresrhys's user avatar
40 votes
3 answers
26k views

Is it possible to run Karma with no browsers at all?

I started an Angular.js app with Yeoman's yo angular that includes Karma testing. Then, the grunt test reasonably failed because Karma can't find any browsers. (The browsers has not been set in the ...
randwa1k's user avatar
  • 1,522
0 votes
1 answer
2k views

Jasmine Karma unit test json.parse function

I am trying to unit test this line of javascript with Jasmine framework : $scope.validerStyleTag = function() { $scope.currentTag = JSON.parse($scope.tagList); for (var i = $scope.listTags....
badaboum's user avatar
  • 853
3 votes
1 answer
2k views

AngularJS testing? Unit Testing and E2E testing?

I have been reading that karma is used for angular unit testing and protractor is for end-to-end testing. If we want to have both unit and E2E testing in my angular application, then how do should it ...
user2573410's user avatar
0 votes
2 answers
2k views

getting error when testing a controller using karma in angularjs

I want to test my application using Karma . i have configured it and write a simple test suite for checking if a controller is present in my application or not. i am getting the error "Type Error : ...
Utpal's user avatar
  • 811
4 votes
1 answer
2k views

How do I fix 404 warnings with Karma for my AngularJS project?

Running "karma:unit" (karma) task INFO [karma]: Karma v0.10.9 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS INFO [PhantomJS 1.9.7 (Mac OS X)]: Connected on ...
Shamoon's user avatar
  • 42.3k
1 vote
2 answers
173 views

Strange behaviour delete keyword phantomjs

Context I have a piece of code that runs through karma with jasmine and phantomjs as a browser, and my problem is that I can't figure out why the delete keyword does not do its job. I looked on ...
axelduch's user avatar
  • 10.8k
6 votes
1 answer
17k views

tutorial and resources for AngularJS Karma [closed]

I am going to implementing unit testing in my application and for that I have chosen Karma. But I am struggling regarding how to write the test cases using Karma syntax. Please give me some starting ...
Utpal's user avatar
  • 811
4 votes
3 answers
5k views

Yeoman, Angular Generator, and Karma Test not working

I'm trying to use Yeoman with the angular-generator to start a new application. I run this command (according to the docs) to start a new app: yo angular my-app-name All dependencies have been ...
teone's user avatar
  • 2,173
-1 votes
1 answer
1k views

$httpBackend handling more than 3 calls

I am currently running angularjs 1.2.10 and using karma/jasmine with angular-mocks-1.2.10 for unit testing and stuck in unit test case for $httpBackend. inside it block describe('sumCtrl'...) ... ...
icanbeacoder's user avatar
  • 1,388
0 votes
1 answer
3k views

node-gyp error for karma

Hi I'm trying to install karma using npm. The packages are fetched and the terminal hangs on the last build error message. Installation npm install -g karma Console log npm http GET https://...
Ashwini Khare's user avatar

1
78 79
80
81 82
93