pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<legend id='ZaSZG'><style id='ZaSZG'><dir id='ZaSZG'><q id='ZaSZG'></q></dir></style></legend>
  • <small id='ZaSZG'></small><noframes id='ZaSZG'>

  • <tfoot id='ZaSZG'></tfoot>

      <bdo id='ZaSZG'></bdo><ul id='ZaSZG'></ul>
  • <i id='ZaSZG'><tr id='ZaSZG'><dt id='ZaSZG'><q id='ZaSZG'><span id='ZaSZG'><b id='ZaSZG'><form id='ZaSZG'><ins id='ZaSZG'></ins><ul id='ZaSZG'></ul><sub id='ZaSZG'></sub></form><legend id='ZaSZG'></legend><bdo id='ZaSZG'><pre id='ZaSZG'><center id='ZaSZG'></center></pre></bdo></b><th id='ZaSZG'></th></span></q></dt></tr></i><div class="ltjtxdz" id='ZaSZG'><tfoot id='ZaSZG'></tfoot><dl id='ZaSZG'><fieldset id='ZaSZG'></fieldset></dl></div>

        您如何將伊斯坦布爾代碼覆蓋率與轉譯的 Typesc

        How do you use Istanbul Code Coverage with transpiled Typescript?(您如何將伊斯坦布爾代碼覆蓋率與轉譯的 Typescript 一起使用?)
        <tfoot id='0tWN4'></tfoot>
        <i id='0tWN4'><tr id='0tWN4'><dt id='0tWN4'><q id='0tWN4'><span id='0tWN4'><b id='0tWN4'><form id='0tWN4'><ins id='0tWN4'></ins><ul id='0tWN4'></ul><sub id='0tWN4'></sub></form><legend id='0tWN4'></legend><bdo id='0tWN4'><pre id='0tWN4'><center id='0tWN4'></center></pre></bdo></b><th id='0tWN4'></th></span></q></dt></tr></i><div class="fvfdxxj" id='0tWN4'><tfoot id='0tWN4'></tfoot><dl id='0tWN4'><fieldset id='0tWN4'></fieldset></dl></div>

        • <legend id='0tWN4'><style id='0tWN4'><dir id='0tWN4'><q id='0tWN4'></q></dir></style></legend>
            <bdo id='0tWN4'></bdo><ul id='0tWN4'></ul>
                <tbody id='0tWN4'></tbody>

                  <small id='0tWN4'></small><noframes id='0tWN4'>

                  本文介紹了您如何將伊斯坦布爾代碼覆蓋率與轉譯的 Typescript 一起使用?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我整個上午都在閱讀有關這方面的文章,試圖正確設置我的環境.但由于某種原因,我沒有得到它.我的設置-

                  I've been reading articles on this all morning trying to get my environment setup correctly. But for some reason I'm not getting it. My setup-

                  /app
                      ... source (mixed js and ts)
                  /scripts
                      ... copied source (js)
                      typescripts.js // transpiled typescript with inline mapping
                  

                  測試運行良好,并且 chrome 調試器中的映射調試被正確映射.但伊斯坦布爾將 typescripts.js 文件視為一個文件,而不是幾十個其他文件的串聯.

                  Tests run fine, and with the mapping debugging in the chrome debugger is mapped correctly. But Istanbul sees the typescripts.js file as one file instead of the concatenation of dozens of other files.

                  為了生成打字稿源,我使用 gulp-typescript.源碼(不包括測試)被轉譯成前面提到的typescripts.js,測試被單獨轉譯并復制到/scripts.

                  To generate the typescript source I'm using gulp-typescript. The source (excluding tests) are transpiled to the aforementioned typescripts.js, and the tests are transpiled individually and copied to /scripts.

                    var ts = require('gulp-typescript');
                    var sourcemaps = require('gulp-sourcemaps');
                    var concat = require('gulp-concat');
                  
                    module.exports = function (gulp, config) {
                       'use strict';
                  
                       // Runs dot ts files found in `www` through the typescript compiler and copies them as js 
                       // files to the scripts directory
                  
                       gulp.task('typescript', ['typescript:tests'], function () {
                          return gulp.src(config.paths.typescript) // [ './www/app/**/*.ts', '!./www/app/**/*.test.ts', '!./www/app/**/*.mock.ts' ]
                             .pipe(sourcemaps.init())
                             .pipe(ts(ts.createProject(config.paths.tsConfig))) // './tsconfig.json'
                             .js
                             .pipe(concat(config.sourcemaps.dest)) // typescripts.js
                             .pipe(sourcemaps.write(config.sourcemaps)) // { includeContent: false, sourceRoot: '/app' } - i've also tried absolute local path
                             .pipe(gulp.dest(config.paths.tmpScripts)); // ./www/scripts
                  
                  
                       });
                  
                       gulp.task('typescript:tests', [], function() {
                          return gulp.src(config.paths.typescriptTests) // [ './www/app/**/*.test.ts', './www/app/**/*.mock.ts' ]
                             .pipe(ts(ts.createProject(config.paths.tsConfig))) // './tsconfig.json'
                             .pipe(gulp.dest(config.paths.tmpScripts)); // ./www/scripts
                       });
                    };
                  

                  生成的 typescripts.js 具有內聯源映射.使用 sourcemap,十幾個 ts 文件大小為 106kb.

                  The resulting typescripts.js has the inline sourcemap. With the sourcemap, the dozen or so ts files results in 106kb.

                  所以從這里開始測試和調試工作正常.

                  現在為了讓伊斯坦布爾代碼覆蓋率正常工作,我安裝了 karma-sourcemap-loader 并將其添加到預處理器中.

                  Now in an attempt to get Istanbul code coverage working properly i've installed karma-sourcemap-loader and added it to the preprocessors.

                  preprocessors: {
                      'www/scripts/typescripts.js': ['sourcemap'],
                      'www/scripts/**/*.js': ['coverage']
                  },
                  

                  我認為這是我需要做的.但它沒有顯示源文件的代碼覆蓋率.我嘗試了 C:/ 的絕對路徑,但這也不起作用.我還嘗試了 gulp-sourcemaps 中的不同選項,例如添加源(將文件推送到 160kb),但也沒有.

                  I'd think this is what I'd need to do. But it does not show code coverage on the source files. I tried the absolute path from C:/ but that didn't work either. I also tried the different options in gulp-sourcemaps like adding source (which pushed the file to 160kb) but no like either.

                  有人讓這個工作嗎?有什么想法我可能做錯了嗎?

                  Has anyone gotten this to work? Any ideas what I could be doing wrong?

                  推薦答案

                  TL;DR: 有一個工具:https://github.com/SitePen/remap-istanbul 描述為通過源地圖重新映射伊斯坦布爾覆蓋范圍的工具

                  TL;DR: There is a tool: https://github.com/SitePen/remap-istanbul described as A tool for remapping Istanbul coverage via Source Maps

                  Sitepan 上的文章 對其進行了更詳細的描述:

                  The article on Sitepan describes it in more detail:

                  Intern 以及其他 JavaScript 測試框架都使用了伊斯坦布爾用于他們的代碼覆蓋率分析.隨著我們開始越來越多地采用TypeScript 用于我們自己的項目,我們繼續努力獲得清楚地了解我們的代碼覆蓋率,因為所有報告僅包括在內我們發出的代碼的覆蓋率.我們不得不嘗試使用編譯器在我們的腦海中試圖找出我們缺少測試覆蓋的地方.我們還喜歡圍繞我們的覆蓋范圍設置指標,讓我們跟蹤我們是否正朝著正確的方向前進.

                  Intern as well as other JavaScript testing frameworks utilise Istanbul for their code coverage analysis. As we started to adopt more and more TypeScript for our own projects, we continued to struggle with getting a clear picture of our code coverage as all the reports only included the coverage of our emitted code. We had to try to use the compilers in our minds to try to figure out where we were missing test coverage. We also like to set metrics around our coverage to let us track if we are headed the right direction.

                  我們中的一些人開始探索我們如何能夠完成將覆蓋率報告映射回其起源并經過一段時間工作,我們創建了 remap-istanbul,一個允許伊斯坦布爾的包覆蓋信息被映射回其源,當有源地圖可用.雖然我們一直專注于 TypeScript,但它可以在任何對發射代碼產生覆蓋的地方使用,包括上面提到的工具!

                  A couple of us started exploring how we might be able to accomplish mapping the coverage report back to its origins and after a bit of work, we created remap-istanbul, a package that allows Istanbul coverage information to be mapped back to its source when there are Source Maps available. While we have been focused on TypeScript, it can be used wherever the coverage is being produced on emitted code, including the tools mentioned above!

                  如何通過 gulp 使用該工具:https://github.com/SitePen/remap-istanbul#gulp-plugin

                  How to use the tool with gulp: https://github.com/SitePen/remap-istanbul#gulp-plugin

                  這篇關于您如何將伊斯坦布爾代碼覆蓋率與轉譯的 Typescript 一起使用?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  <tfoot id='SnHD9'></tfoot>
                  <legend id='SnHD9'><style id='SnHD9'><dir id='SnHD9'><q id='SnHD9'></q></dir></style></legend>
                  <i id='SnHD9'><tr id='SnHD9'><dt id='SnHD9'><q id='SnHD9'><span id='SnHD9'><b id='SnHD9'><form id='SnHD9'><ins id='SnHD9'></ins><ul id='SnHD9'></ul><sub id='SnHD9'></sub></form><legend id='SnHD9'></legend><bdo id='SnHD9'><pre id='SnHD9'><center id='SnHD9'></center></pre></bdo></b><th id='SnHD9'></th></span></q></dt></tr></i><div class="5tnhz7v" id='SnHD9'><tfoot id='SnHD9'></tfoot><dl id='SnHD9'><fieldset id='SnHD9'></fieldset></dl></div>

                  <small id='SnHD9'></small><noframes id='SnHD9'>

                    <tbody id='SnHD9'></tbody>
                      • <bdo id='SnHD9'></bdo><ul id='SnHD9'></ul>

                            主站蜘蛛池模板: 别墅图纸超市|别墅设计图纸|农村房屋设计图|农村自建房|别墅设计图纸及效果图大全 | 流量检测仪-气密性检测装置-密封性试验仪-东莞市奥图自动化科技有限公司 | 南汇8424西瓜_南汇玉菇甜瓜-南汇水蜜桃价格 | Boden齿轮油泵-ketai齿轮泵-yuken油研-无锡新立液压有限公司 | BAUER减速机|ROSSI-MERSEN熔断器-APTECH调压阀-上海爱泽工业设备有限公司 | 南京兰江泵业有限公司-水解酸化池潜水搅拌机-絮凝反应池搅拌机-好氧区潜水推进器 | 学校用栓剂模,玻璃瓶轧盖钳,小型安瓿熔封机,实验室安瓿熔封机-长沙中亚制药设备有限公司 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 滑石粉,滑石粉厂家,超细滑石粉-莱州圣凯滑石有限公司 | 展厅设计公司,展厅公司,展厅设计,展厅施工,展厅装修,企业展厅,展馆设计公司-深圳广州展厅设计公司 | 哈尔滨京科脑康神经内科医院-哈尔滨治疗头痛医院-哈尔滨治疗癫痫康复医院 | 红酒招商加盟-葡萄酒加盟-进口红酒代理-青岛枞木酒业有限公司 | 深圳货架厂家_金丽声精品货架_广东金丽声展示设备有限公司官网 | 机床主轴维修|刀塔维修|C轴维修-常州翔高精密机械有限公司 | 货车视频监控,油管家,货车油管家-淄博世纪锐行电子科技 | 整车VOC采样环境舱-甲醛VOC预处理舱-多舱法VOC检测环境仓-上海科绿特科技仪器有限公司 | Honsberg流量计-Greisinger真空表-气压计-上海欧臻机电设备有限公司 | 鄂泉泵业官网|(杭州、上海、全国畅销)大流量防汛排涝泵-LW立式排污泵 | 东莞喷砂机-喷砂机-喷砂机配件-喷砂器材-喷砂加工-东莞市协帆喷砂机械设备有限公司 | 硬度计,金相磨抛机_厂家-莱州华煜众信试验仪器有限公司 | 骨密度仪-骨密度测定仪-超声骨密度仪-骨龄测定仪-天津开发区圣鸿医疗器械有限公司 | 空心明胶胶囊|植物胶囊|清真胶囊|浙江绿键胶囊有限公司欢迎您! | 【中联邦】增稠剂_增稠粉_水性增稠剂_涂料增稠剂_工业增稠剂生产厂家 | 济南品牌包装设计公司_济南VI标志设计公司_山东锐尚文化传播 | 福建成考网-福建成人高考网 | 半自动预灌装机,卡式瓶灌装机,注射器灌装机,给药器灌装机,大输液灌装机,西林瓶灌装机-长沙一星制药机械有限公司 | 软装设计-提供软装装饰和软装配饰及软装陈设的软装设计公司 | 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 环氧铁红防锈漆_环氧漆_无溶剂环氧涂料_环氧防腐漆-华川涂料 | 首页-恒温恒湿试验箱_恒温恒湿箱_高低温试验箱_高低温交变湿热试验箱_苏州正合 | 谷梁科技 | 槽钢冲孔机,槽钢三面冲,带钢冲孔机-山东兴田阳光智能装备股份有限公司 | 南京PVC快速门厂家南京快速卷帘门_南京pvc快速门_世界500强企业国内供应商_南京美高门业 | 除甲醛公司-甲醛检测治理-杭州创绿家环保科技有限公司-室内空气净化十大品牌 | 工业淬火油烟净化器,北京油烟净化器厂家,热处理油烟净化器-北京众鑫百科 | 东莞爱加真空科技有限公司-进口真空镀膜机|真空镀膜设备|Polycold维修厂家 | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | DDoS安全防护官网-领先的DDoS安全防护服务商 | 英语词典_成语词典_日语词典_法语词典_在线词典网 |