karma-runner

Explain karma unit test times

血红的双手。 提交于 2019-12-31 02:36:28
问题 I've been searching the web for this for two days and I found nothing. Maybe I'm looking in the wrong way — I don't know... So here it is: what are the times on my console when running a Karma+Jasmine+phantomJs unit test? ... Executed 1 of 1 SUCCESS (0.878 secs / 0.112 secs) First, I though that the second time is the total unit test time (for example, when running multiple tasks), however, sometimes the first time gets to be 'bigger', sometimes not... Anyone? 回答1: total time / net time net

Using Karma-runner with AngularJS, Jasmine, CoffeScript

巧了我就是萌 提交于 2019-12-31 01:56:15
问题 My app besides jRuby/Rails uses AngularJS , CoffeScript . I'd like to test my javascript with Jasmine and run it with Karma (aka Testacular ), but I get an error stating that my Angular module is nowhere defined . What I've got: installed Node.js and Karma , generated a config file: // base path, that will be used to resolve files and exclude basePath = '../'; // list of files / patterns to load in the browser files = [ JASMINE, JASMINE_ADAPTER, 'vendor/assets/javascripts/angular.js', 'vendor

PhantomJS does not work with Karma in Angular2 project

时间秒杀一切 提交于 2019-12-30 18:28:15
问题 I have created an out-of-the box project with the angular cli (1.0.0-rc1.0.0). Then I installed the PhantomJS plugin ( npm install karma-phantonjs-launcher ). Reproduction steps: create project with angular2 cli ( ng new TestPhantomJS ) run npm install karma-phantonjs-launcher in the karma.conf file add PhantomJS, ie change to browsers: ['Chrome'] this browsers:['Chrome', 'PhantomJS'] Reason beeing that for Team City integration I need a headless browser. The test run OK with ng test as long

Testacular install fails, no vcbuild.exe

十年热恋 提交于 2019-12-30 01:46:11
问题 I'm trying to install Testacular (using nmp) on a Windows 8 Professional (64 bit) laptop, but it fails when it tries to install socket.io as part of this process. The error I get is Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. I apparently have .NET framework 3.5 installed (it's checked under the add

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

心不动则不痛 提交于 2019-12-29 12:12:29
问题 I have a rails project and am running tests for my JavaScript test (Jasmine) through Karma .travis.yml file language: ruby rvm: - 2.0.0 script: - RAILS_ENV=test bundle exec rake --trace db:migrate test - karma start --single-run --browsers PhantomJS test/karma/config/unit.js Travis fails saying it does not find karma. is there a way to define node_js as another language and install karma on the build VM? 回答1: It is not possible yet to have several languages on travis configuration file. On

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

北城余情 提交于 2019-12-29 12:12:13
问题 I have a rails project and am running tests for my JavaScript test (Jasmine) through Karma .travis.yml file language: ruby rvm: - 2.0.0 script: - RAILS_ENV=test bundle exec rake --trace db:migrate test - karma start --single-run --browsers PhantomJS test/karma/config/unit.js Travis fails saying it does not find karma. is there a way to define node_js as another language and install karma on the build VM? 回答1: It is not possible yet to have several languages on travis configuration file. On

Karma + Jasmine: Cannot read property 'getComponentFromError'

天大地大妈咪最大 提交于 2019-12-29 07:42:40
问题 I am following this tutorial: https://angular.io/guide/testing#component-test-scenarios for karma+jasmine unit testing. Here my code: import { AppComponent } from "./app.component"; import { ComponentFixture, TestBed } from "@angular/core/testing"; describe('AppComponent', () => { let component: AppComponent; let fixture: ComponentFixture<AppComponent>; let h1: HTMLElement; beforeEach(() => { TestBed.configureTestingModule({ declarations: [ AppComponent ], }); fixture = TestBed

AngularJs unit testing memory leaks

前提是你 提交于 2019-12-29 02:44:50
问题 as you may already know many of us who have a large quantity of written unit test has met with this not trivially solvable problem. I have around 3500+ unit tests written in the Jasmine syntax following the AngularJs unit testing guide. The tests are executed with Karma runner. The problem is that they cannot be executed all at once due to some memory leaks. While running them the memory builds up no matter on what browser they are runned on and at some point the browser crashes and

How to deal with angular module's config function when unit testing?

别等时光非礼了梦想. 提交于 2019-12-28 15:11:49
问题 When setting up a unit test suite for an angular application using Karma/Jasmine, is it recommended to include the js with the app module's config function in the test's files? I've read that it is suggested to exclude this from testing, however that seems awkward because there's often critical setup that happens in the config function that would prevent the application from working. What's the best practice around this? Create a mock config function that does the same thing in a 'mocked'

How to deal with angular module's config function when unit testing?

╄→尐↘猪︶ㄣ 提交于 2019-12-28 15:09:27
问题 When setting up a unit test suite for an angular application using Karma/Jasmine, is it recommended to include the js with the app module's config function in the test's files? I've read that it is suggested to exclude this from testing, however that seems awkward because there's often critical setup that happens in the config function that would prevent the application from working. What's the best practice around this? Create a mock config function that does the same thing in a 'mocked'