karma-runner

$browser.$$checkUrlChange is undefined in a jasmine test

浪子不回头ぞ 提交于 2020-01-02 03:41:04
问题 I have the following test: it('should maintain a bind between the data at the $scope to the data at the ingredientsService', function(){ $scope.addFilters('val1', $scope.customFiltersData, 'filter1'); $scope.$digest(); expect($scope.customFiltersData).toEqual(ingredientsService.filters()); }); I get the following error: TypeError: undefined is not a function at Scope.$digest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12502:17) at null.<anonymous> (/home/oleg/dev/vita

npm install -g karma does not install executable

时光毁灭记忆、已成空白 提交于 2020-01-02 03:24:27
问题 I have what looks like successful karma installation, yet karma is not in /usr/local/bin/ and is not found by bash. Any idea what is wrong and how to fix it? Here are the end installation messages: > ws@0.4.31 install /usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws > (node-gyp rebuild 2> builderror.log) || (exit 0) CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/bufferutil.node SOLINK_MODULE(target

Angular mock fails to inject my module dependencies

五迷三道 提交于 2020-01-02 01:07:18
问题 I want to test an Angular controller for my application fooApp , defined as follow: var fooApp = angular.module('fooApp', [ 'ngRoute', 'ngAnimate', 'hmTouchEvents' ]); ... The controller, MainCtrl is defined: "use strict"; fooApp.controller('MainCtrl', function ($scope, $rootScope, fooService) { ... } So I've tested several ways to create a test, like this one: 'use strict'; describe('MainController test', function () { var scope; var controller; beforeEach(function () { angular.mock.module(

Sonarqube default coverage to 0 from Karma Coverage LCOV file with absolute pathjs

我们两清 提交于 2020-01-01 19:30:25
问题 Sonar does not retrieve the coverage information for my project when paths are absolute in my lcov file. For the file: TN: SF:/mnt/vg01-data01/jenkins/<jenkins.myhost.com>/jenkins_home/workspace/<job1>/src/app.js FN:,(anonymous_0) FN:,(anonymous_1) FNF:2 FNH:2 FNDA:1,(anonymous_0) FNDA:2,(anonymous_1) DA:3,1 DA:4,1 DA:6,1 DA:7,1 DA:8,1 DA:9,1 DA:11,1 DA:18,1 DA:19,1 DA:22,2 DA:27,1 LF:11 LH:11 BRF:0 BRH:0 end_of_record .... I get the following warnings: ... 05:06:27.565 INFO: Analysing [/srv

Debugging karma-jasmine tests with node-inspector

本小妞迷上赌 提交于 2020-01-01 10:47:10
问题 Almost the same question as Debugging jasmine-node tests with node-inspector BUT does anyone know how to use node-inspector with karma? 回答1: Install the node-inspector globally from NPM: npm install -g node-inspector Then start the node-inspector and background the process (use fg to bring it back to the foreground and kill %1 to stop it): node-inspector & And then start your test runner like in debug mode this node --inspect ./node_modules/karma/bin/karma start Then connect to the inspector

karma.conf.js automatic file ordering?

不羁岁月 提交于 2020-01-01 05:03:34
问题 I have a large angularjs project ordered by features. I'd like to setup unit testing but I'm having trouble getting the karma.conf.js file ordering setup. I tried specifying a simple glob pattern like **/*.js but many of my modules failed to load due to the ordering that they're included in Karma when ran. As I understand, it's alphabetical, first match. I was able to resolve this by manually figuring out the ordering by doing something like this: // list of files / patterns to load in the

karma.conf.js automatic file ordering?

ε祈祈猫儿з 提交于 2020-01-01 05:03:08
问题 I have a large angularjs project ordered by features. I'd like to setup unit testing but I'm having trouble getting the karma.conf.js file ordering setup. I tried specifying a simple glob pattern like **/*.js but many of my modules failed to load due to the ordering that they're included in Karma when ran. As I understand, it's alphabetical, first match. I was able to resolve this by manually figuring out the ordering by doing something like this: // list of files / patterns to load in the

Angular Karma Jasmine Error: Illegal state: Could not load the summary for directive

北慕城南 提交于 2019-12-31 10:56:52
问题 I'm developing a github repository (with angular 7 and angular-cli), and I have some tests with Karma and Jasmine working in the master branch. Now I'm trying to add lazy loading feature, the thing is, that the tests that before passed, now they do not. It's funny because only the tests from the lazy loading module are failing... Here is the code and the error: import {async, TestBed} from '@angular/core/testing'; import {APP_BASE_HREF} from '@angular/common'; import {AppModule} from '../..

Karma + JSPM + Typescript - not found '.ts.js'

…衆ロ難τιáo~ 提交于 2019-12-31 07:01:32
问题 Mainly just trying to get Karma+JSPM to play nice on loading the .ts files but having absolutely no luck. I see up a discussion repo with a stripped down example. Basically JSPM within Karma is seemingly ignoring the defaultJSExtensions: true and package level "defaultExtension": "ts" configurations when running in Karma giving the following error when attempting to load files: $ npm test > karma-jspm-typescript-coverage@1.0.0 test C:\examples\karma-jspm-typescript-coverage > karma start 18

Karma + JSPM + Typescript - not found '.ts.js'

戏子无情 提交于 2019-12-31 07:01:32
问题 Mainly just trying to get Karma+JSPM to play nice on loading the .ts files but having absolutely no luck. I see up a discussion repo with a stripped down example. Basically JSPM within Karma is seemingly ignoring the defaultJSExtensions: true and package level "defaultExtension": "ts" configurations when running in Karma giving the following error when attempting to load files: $ npm test > karma-jspm-typescript-coverage@1.0.0 test C:\examples\karma-jspm-typescript-coverage > karma start 18