简体   繁体   English

如何在我的Jenkins构建中排除/包含某些component.spec.ts文件

[英]How do I exclude/include certain component.spec.ts files from running in my Jenkins build

I am trying to get my spec.ts files into sonarqube to get code coverage . 我试图将我的spec.ts文件放入sonarqube以获得代码覆盖率。 But my Jenkins build is failing because of some spec.ts files. 但是由于一些spec.ts文件,我的Jenkins构建失败了。 Is there any way to exclude these spec.ts files and only include certain files in the Jenkins build given that I cannot delete the spec.ts files from the angular package. 有没有办法排除这些spec.ts文件,只包括Jenkins构建中的某些文件,因为我无法从angular包中删除spec.ts文件。

There are various ways: 有各种方法:

  1. Change the glob patterns in your tsconfig.spec.json 更改tsconfig.spec.json的glob模式
  2. To exclude a describe block change it to xdescribe 要排除describe blockxdescribe其更改为xdescribe
  3. To exclude a specific test it change it to xit 要排除特定测试, it更改为xit

Reading a little bit more on Jasmine will help. 阅读更多关于Jasmine的信息会有所帮助。 https://jasmine.github.io/pages/getting_started.html https://jasmine.github.io/pages/getting_started.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 tsconfig.json 中排除以“.spec.ts”结尾的文件 - How to exclude files ending in '.spec.ts' in tsconfig.json TypeScript 编译中缺少 home.component.spec.ts 错误。 请通过“文件”或“包含”属性确保它在您的 tsconfig 中 - Error home.component.spec.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property 如何将数据从组件传递到包含数组的 .ts 文件? - How do I pass data from a component to a .ts file holding my array? 如何从 Typescript 编译中排除某些文件? - How can I exclude certain files from being compiled in Typescript? 如何从捆绑 .spec.js 文件中排除 webpack - How to exclude webpack from bundling .spec.js files 如何从给定的字符串中排除某些字符? - How do i exclude certain characters from a given string? 如何在 Svelte / Sapper 的 __sapper__ 构建中包含我的服务器的文件 - How do I include files for my sever in __sapper__ build in Svelte / Sapper 如何从生产构建中排除钩子 - How do I exclude a hook from a production build 如何排除茉莉花中的一些规范文件? - How to exclude some spec files in jasmine? 如何手动在组件中包含“ @ material / drawer”? - How do I manually include “@material/drawer” into my component?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM