【问题标题】:Is it possible to do diff coverage for angular 9 projects?是否可以对 Angular 9 项目进行差异覆盖?
【发布时间】:2021-09-22 08:24:38
【问题描述】:

我目前正在为我的前端和 .Net CORE 开发 Angular 9。通过执行以下操作,我已经能够为后端项目实现差异覆盖:

在我的 azure-pipeline.yml 中

  - task: DotNetCoreCLI@2
    inputs:
      command: test
      projects: '**/*Tests/*.csproj'
      arguments: '--configuration $(buildConfiguration) --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
    displayName: 'Run backend endpoint tests'

然后我添加了 azurepipelines-coverage.yml 与以下内容:

coverage:
  status:           # Code coverage status will be posted to pull requests based on targets defined below.
    comments: on    # Off by default. When on, details about coverage for each file changed will be posted as a pull request comment. 
    diff:           # Diff coverage is code coverage only for the lines changed in a pull request.
      target: 60%   # Set this to a desired percentage. Default is 70 percent

我想知道是否可以为我的 Angular 项目做同样的事情?我正在使用 jest 进行测试。

【问题讨论】:

    标签: c# angular jestjs azure-pipelines test-coverage


    【解决方案1】:

    不幸的是,目前 Azure DevOps 仅支持使用 Visual Studio 代码覆盖结果格式的 .NET 和 .NET 核心项目。

    来自Code coverage for pull requests

    虽然您可以使用 Azure Pipelines 收集和发布多种不同语言的代码覆盖率结果,但本文档中讨论的拉取请求功能的代码覆盖率目前仅适用于使用 Visual Studio 代码覆盖率结果的 .NET 和 .NET 核心项目格式(文件扩展名 .coverage)。未来的里程碑中将添加对其他语言和覆盖范围格式的支持。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-03
      • 1970-01-01
      • 1970-01-01
      • 2019-04-20
      • 1970-01-01
      • 1970-01-01
      • 2022-11-23
      相关资源
      最近更新 更多