karma-coverage

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

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

How can i coverage a promise response with Jasmine and Karma

狂风中的少年 提交于 2019-12-25 01:12:10
问题 I have a function that returns and treats a promise, I need to cover the return that is inside then but I don't know how I can do this, I'm currently trying as follows: confirmRemoveUser(user: IUser) { this.modalService .open('Confirma a exclusão do usuário selecionado?', { titleText: 'Confirmando exclusão', confirmButtonText: 'Sim', cancelButtonText: 'Cancelar', closeButtonText: 'Fechar', buttonType: 'danger' }) .result.then( (result: BentoModalConfirmationCloseReason) => { if (result ===

Getting Karma, 6to5ify and Istanbul to play ball

两盒软妹~` 提交于 2019-12-22 05:04:19
问题 I have Browserify, 6to5ify and Karma to play nice, successfully running my specs. When I add code coverage however, things go south. I've tried several approaches: Add browserify-istanbul transform to my karma.conf.js. However, this results in it trying to run instrumentation on my spec-files as well it would appear. Run coverage preprocessor on my source files. But because istanbul (even douglasduteil/karma-coverage#next ) doesn't read my 6to5ify browserify transform, this crashes

SonarQube and Lcov report Could not resolve file paths

时光毁灭记忆、已成空白 提交于 2019-12-18 05:04:30
问题 We are trying to make a SonarQube code coverage report for our angular application. We have used Karma to generate a code coverage report and import it into SonarQube analyzer. The SonarQube already has C# coverage for our project, now we want to add JavaScript code coverage as well. Teamcity calls, Karma and it creates a code coverage and put the lcov file and report files into src\Planning.Spa\Coverage\report folder. LCOV File TN: SF:E:/a03/work/bb52cb33e083fc9/src/Planning.Spa/Offer/app

Asking about the Coverage summary in Unit test of angular 2?

空扰寡人 提交于 2019-12-13 14:23:33
问题 When I run test in angular 2 and I see a few keywords output on console command in Coverage Summary section as Statements , Branches , Functions .... And I don't know exactly what is it? Any help explain this for me, thank you. 回答1: Statement : I think this article does a pretty goo d job explaining what a statement it. The coverage tests that all your statements are getting hit. Branch : When you use conditionals it create branches if (condition) { doThis(); // this is a branch } else {

Karma Coverage and Babel+Browserify Preprocessing

假装没事ソ 提交于 2019-12-12 12:08:51
问题 I'm using Karma to test my ES6 code. When I add karma-coverage to the mix, I need to add all the source files for the coverage tool to make a useful report, but when I do that, Karma gives me this error in all browsers: PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR Error: Invariant Violation: _registerComponent(...): Target container is not a DOM element. at /var/folders/55/9_128mq95kz1q_2_vwy7qllw0000gn/T/41cf272955d73fbba8ad1df941172139.browserify:46444:0 <- ../../node_modules/react/lib/invariant

Karma, coverage report combined with webpack

拜拜、爱过 提交于 2019-12-11 06:39:29
问题 I have karma set up along with the coverage tool which is working - but as I'm also using webpack, the coverage report is using the bundled code that webpack has created. For example: I have a Typescript file that includes an external library, so in order for that file to run it needs webpack. Webpack then includes that file into the compiled JS. This means that when I get the coverage report its % is low as I'm not testing the external file which has now been included. preprocessors: { '.

Lcov report from Karma is not getting uploaded into sonar

假装没事ソ 提交于 2019-12-11 06:36:27
问题 I am trying to publish lcov reports from karma to sonar, the report is getting generated in jenkins but its not getting uploaded into sonar. Our's is a angularJS maven project. Already sonar is analysing junit testing now I'm trying to analysize javascript using karma but ist not happening. I tried adding Kindly let me know if I am missing something.... #Karma reports sonar.javascript.jstestdriver.reportsPath=reports/ sonar.javascript.lcov.reportPath=src/main/webapp/coverage/lcov.info 来源: