chutzpah

Jasmine in a separate test project

拈花ヽ惹草 提交于 2019-12-20 09:47:52
问题 Is it practical/possible to separate jasmine tests into a separate visual studio project? I am just getting started with angular, and am trying to write my tests before I start on the actual angular implementation. I will be writing my project in Visual Studio 2012 with the Chutzpah test runner , see this video. Currently, I am trying to figure out how to organize my folder structure. I know about angular-seed and yeoman, but those are ill suited to starting a .net project. I am assuming that

AngularJS - Controller not registered

蹲街弑〆低调 提交于 2019-12-12 02:33:50
问题 I am starting out on AngularJS Unit Testing and I am getting an error like Controller with name "SiteCtrl" is not registered. What I am doing wrong here? describe('#hasFormError', function () { var $rootScope,form, templateHtml, ctrl,$scope,scope; angular.module("TestApp"); beforeEach(function () { angular.module("TestApp"); }); beforeEach(inject(function ($rootScope, $controller, $compile, $templateCache) { $scope = $rootScope.$new(); ctrl = $controller; ctrl('SiteCtrl', { $scope: scope });

Visual Studio's Test Runner with Chutzpah won't recognize QUnit tests when using both Requirejs and knockoutjs

孤人 提交于 2019-12-11 01:59:29
问题 I'm trying to get VS 2013 test explorer with Chutzpah to recognize QUnit tests while I'm using require.js in combination with knockoutjs I've found some good resources listed below but I think I must just have one missing piece. This is what I used to ensure I was using Qunit and require.js together correctly. From this resource, it sounds like I need a Chutzpah.json file as well. Here is what I can reproduce: If I just use Chutzpah and qunit I can get it to work so I know I have Chutzpah

Does phantomJS support geolocations?

青春壹個敷衍的年華 提交于 2019-12-10 03:17:13
问题 I'm trying to run qunit test cases with PhantomJS. One of my tests are hanging in when phantomJS try to access the navigator.geolocation function of DOM. same test is working fine in the browser, just hangs in the console with phantomJS. doe phantomJS support geolocations ? any suggestion? breaks in the following if condition if(navigator.geolocation) { window.navigator.geolocation.watchPosition(updateLocation, null, { frequency: 3000 }); } 回答1: No. Simply check the features.js example.

How can I test a directive using templateUrl in Chutzpah's headless browser

拥有回忆 提交于 2019-12-09 08:03:59
问题 Does anyone know how to get a headless browser like Chutzpah's Visual Studio Test Adapter to allow a directive to access its .html template file? Chutzpah uses PhantomJS for a headless browser which appears to limit my options. I'm using Chutzpah Test Adapter 2.5 and AngularJS 1.2.0-r.2. I get the error: Unexpected request: GET myApp/directives/template.html Which is caused by Angular attempting to use the $http service to access my directive's template. I've found a few different workarounds

Chutzpah running Jasmine in TFS 2012 can't find referenced file under test

核能气质少年 提交于 2019-12-07 09:30:18
问题 I am using Chutzpah to run our Jasmine tests. I have added the Chutzpah dlls to the solution and updated the build to run *.js tests. The project structure is as follows: MyApp.Web Scripts App Home DateControl.js MyApp.Web.Tests Scripts Jasmine lib Chutzpah (dlls) Spec App Home DateControlSpecs.js The Jasmine test file uses a reference tag to reference the file to be tested /// <reference path="../../../../../../App.web/scripts/app/home/datecontrol.js" /> The Jasmine tests are run however I

Chutzpah coverage result smaller than 100% (due to private methods?)

限于喜欢 提交于 2019-12-06 07:54:19
I use Chutzpah to test my JavaScript test coverage. Here is an example for the coverage result when I run a single test file referenceFigureEdit.spec.js : I would expect the coverage to be 100% but it is only 91.07%. Clicking on the first line I can inspect my tested code in detail. Lines that are "not covered by the test" are highlighted: Question A : How can I tell Chutzpah that those methods have actually been executed or tell Chutzpah to not include those lines in the coverage result? Are there some restrictions on where/when code has to be executed to be part of the successful coverage? I

Using Chutzpah to run Typescript qUnit tests

拥有回忆 提交于 2019-12-05 17:27:02
I've recently tried to incorporate qUnit and Chutzpah to unit test a project I'm working on which is written in typescript. I've got things setup in what I believe is the correct manner and the following things work: The typescript application! - I can run a very early version of the application Chutzpah - I installed this on VS2012 and it correctly see's my qUnit demo test qUnit - Appears installed and works with Chutzpah, I can run a simple test (one which doesn't look at my code) With these three in place I presumed I could begin to write tests for the typescript app, as a test I wrote a

Chutzpah running Jasmine in TFS 2012 can't find referenced file under test

帅比萌擦擦* 提交于 2019-12-05 14:13:33
I am using Chutzpah to run our Jasmine tests. I have added the Chutzpah dlls to the solution and updated the build to run *.js tests. The project structure is as follows: MyApp.Web Scripts App Home DateControl.js MyApp.Web.Tests Scripts Jasmine lib Chutzpah (dlls) Spec App Home DateControlSpecs.js The Jasmine test file uses a reference tag to reference the file to be tested /// <reference path="../../../../../../App.web/scripts/app/home/datecontrol.js" /> The Jasmine tests are run however I get the following error: ReferenceError: Can't find variable: dateControl in file dateControl is the

Karma vs Chutzpah

↘锁芯ラ 提交于 2019-12-04 02:20:08
I have been trying to figure out what is the best way to write/run automated jasmine tests in visual studio. Currently, I am using jasmine with Resharper (using PhantomJS) and the test can be run from visual studio. Now I want to run the tests as part of continuous integration and very are using TFS. Searching online give me few options which made me rather confused. 1) Use Chutzpah as a test runner to execute jasmine tests. 2) Use Karma as a test runner (but it also requires Chutzpah test adaptor for visual studio). I get the feeling that using Karma is somewhat better than anything else but