UI-router interfers with $httpbackend unit test, angular js

Take this gist https://gist.github.com/wilsonwc/8358542 angular.module(‘stateMock’,[]); angular.module(‘stateMock’).service(“$state”, function($q){ this.expectedTransitions = []; this.transitionTo = function(stateName){ if(this.expectedTransitions.length > 0){ var expectedState = this.expectedTransitions.shift(); if(expectedState !== stateName){ throw Error(“Expected transition to state: ” + expectedState + ” but transitioned to ” + stateName ); } }else{ throw Error(“No more transitions were expected! Tried to transition to “+ stateName ); … Read more

Is it possible to set up travis to run tests for several languages?

It is not possible yet to have several languages on travis configuration file. On the other hand, all environments run node.js. The following script does the trick: language: ruby rvm: – 2.0.0 before_script: – npm install karma script: – RAILS_ENV=test bundle exec rake –trace db:migrate test – karma start –single-run –browsers PhantomJS test/karma/config/unit.js Help found … Read more

How to get better test reports in the console?

Fixed by installing the karma-spec-reporter npm install karma-spec-reporter –save-dev and adding this my karma.config.js reporters: [‘spec’], According to karma documentation By default, Karma loads all NPM modules that are siblings to it and their name matches karma-*. but some users have had to add the following to their config plugins: [‘karma-spec-reporter’]

Include dependencies in Karma test file for Angular app?

In karma configuration file (karma.conf.js) you need to define all libraries. etc. // list of files / patterns to load in the browser files: [ ‘app/lib/angular/angular.js’, ‘app/lib/angular-route/angular-route.js’, ‘test/lib/angular-mocks.js’, ‘app/app.js’, ‘app/controllers/*.js’, ‘app/services/*.js’, ‘app/*’, ‘test/spec/**/*.js’ ],

angular cli exclude files/directory for `ng test –code-coverage`

With the latest CLI, inside angular.json “test”: { “builder”: “@angular-devkit/build-angular:karma”, “options”: { “main”: “src/test.ts”, “polyfills”: “src/polyfills.ts”, “tsConfig”: “src/tsconfig.spec.json”, “karmaConfig”: “./karma.conf.js”, “codeCoverageExclude”: [“src/testing/**/*”],

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)