如何指向打字稿文件而不​​是javascript文件业力奔跑者Webstorm [英] Howto point to typescript file instead of javascript file karma runner webstorm

查看:69
本文介绍了如何指向打字稿文件而不​​是javascript文件业力奔跑者Webstorm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WebStorm中设置了项目,以将TypeScript转换为JavaScript等. 所以我用TypeScript编写代码和测试.

I have my project setup in WebStorm to transpile TypeScript into JavaScript etc. So I write my code as well as my tests in TypeScript.

当我在网络风暴中运行具有覆盖范围的业力"时,一切运行正常.

When I run "Karma with coverage" in webstorm it all runs fine.

但是,例如,当测试失败时,输出将始终指向javascript文件.因此,当我单击失败的测试时,它将打开javascript文件而不是打字稿文件

But, when for example a tests fails, the output keeps pointing to the javascript files. So when I click the failing test, it opens up the javascript file instead of the typescript file

这里也有一种整合映射的方法吗?

Is there a way to integrate the mappings here as well?

我当前的预处理器设置:

My current preprocessor setup:

preprocessors: {
  'app/resources/**/*.ts': ['typescript'],
  //'app/resources/**/!(*spec).ts': ['sourcemap', 'coverage'],
  'app/resources/**/!(*spec).js': ['sourcemap', 'coverage'],
  'app/resources/**/*.html': ['ng-html2js']
},

我看了看: https://www.npmjs.com/browse/keyword/karma-preprocessor,并搜索了打字稿.基本上,我只找到可以编译/转换打字稿文件的预处理器,但这是我在测试过程中已经做过的事情.所以我相信我可以省去'typescript'预处理器了吗?

I've taken a look at: https://www.npmjs.com/browse/keyword/karma-preprocessor and did a search for typescript. Basically I only find preprocessor that compile/transpile the typescript files, but that is something I already do in my test process. So I believe I can just leave the 'typescript' preprocessor out?

谢谢!

推荐答案

对此存在一个未解决的问题:

There is an open issue for this: https://youtrack.jetbrains.com/issue/WEB-13081

这篇关于如何指向打字稿文件而不​​是javascript文件业力奔跑者Webstorm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆