karma-runner

grunt karma testing on vagrant when host changes sources grunt/karma doesn't detect it

怎甘沉沦 提交于 2020-01-13 10:14:52
问题 This took me ages to find out but can't seem to find a solution for this one. Using vagrant I run a Fedora 20 guest that runs grunt/karma. The sources I edit on my host but when I save grunt isn't detecting the change so no tests are being done. Figured it was a configuration problem so tried many combinations of things here without success. Finally I opened a second ssh to the guest vagrang ssh and changed the file in the other ssh terminal echo " " >> app/js/app.js and see that now grunt

Karma can't load webpack

人走茶凉 提交于 2020-01-13 09:47:11
问题 I'm getting this error; 16 07 2015 13:03:52.741:WARN [preprocess]: Can not load "webpack"! Error: Can not resolve circular dependency! (Resolving: preprocessor:webpack -> webpackPlugin -> preprocessor:webpack) My karma.conf looks like; var webpack = require('webpack'); module.exports = function (config) { config.set({ browsers: [ 'Chrome' ], //run in Chrome singleRun: true, //just run once by default frameworks: [ 'mocha' ], //use the mocha test framework files: [ 'tests.webpack.js' //just

Error: Unexpected request: GET views/partials/* for a nested directive even when using html2js in karma/jasmine unit test

戏子无情 提交于 2020-01-13 09:29:47
问题 I am using Karma and Jasmine for unit testing for my angularjs application. I have a directive's(say Directive A) template in which another directive(say Directive B) is getting rendered, although it is working fine in application but test case fails to render the Directive B's template. Following is the error I get :- Error: Unexpected request: GET views/partials/directiveb.html Expected GET https://my-sandbox.app.com/123456 Below is the directive A's code :- angular.module('myApp')

Unexpected token while running karma-coverage on Typescript project

删除回忆录丶 提交于 2020-01-13 07:52:25
问题 I have a basic Angular/Typescript project with 12 rudimentary unit tests that run perfectly fine. Now I would like to get the coverage for these tests. I tried various approaches, and none of them worked, so I decided to start over with karma-coverage and ask for help here. :-) Currently, when I run karma, I get an error message for every single source file that looks like this: Failed to parse file: C:/Users/FRBA/Documents/MyProject/src/app/nav/new-panel/new-panel.component.ts 07 07 2017 07

How use require inside a spec - grunt + karma + jasmine in node

余生颓废 提交于 2020-01-13 02:55:08
问题 Vague version question: How can I use require inside a spec with grunt? Context: I'm working on an existent node project that has no tests yet, so I read some and realized to use karma and jasmine. I read some tutos (including these): http://kwilson.me.uk/blog/use-karma-and-grunt-to-run-your-jasmine-tests-in-real-time/ http://ahexamples.blogspot.com.br/2014/03/example-of-jasmine-karma-sonar-grunt.html So I'm trying to run my specs with grunt and getting this error: X encountered a declaration

Karma vs Chutzpah

笑着哭i 提交于 2020-01-12 14:17:35
问题 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

Karma vs Chutzpah

南楼画角 提交于 2020-01-12 14:14: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

Karma vs Chutzpah

十年热恋 提交于 2020-01-12 14:14:03
问题 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

How do I debug a Jasmine spec run with Testacular (Karma)?

我们两清 提交于 2020-01-12 13:50:09
问题 I have a small project with Jasmine specs and I am using Testacular as my test runner. I don't understand how I can debug, both the app code or the spec code. When I try to set a breakpoint in Chrome Dev Tools it isn't hit next time the specs run because it loads the files every time with a new query string. The best thing I found so far is to use console.log() but I would rather use Chrome Dev Tools breakpoints. (I am using Visual Studio 2012 for development.) Thanks 回答1: Testacular is not

karma start - passing parameters

梦想的初衷 提交于 2020-01-11 05:10:49
问题 Is there a way to pass a parameter thru the Karma command line and then read that somewhere in your tests? For instance, this is what want: karma start -branding="clientX" And then somewhere in my specs I would need to access this variable (I need the "clientX" value). Is this possible at all? 回答1: It is possible to transmit parameters to test cases. It can be a bit tricky. What you can to do is check for __karma__.config.args in you test suite: it("get karma args", function () { console.log(