首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >文档覆盖率Compodoc和角

文档覆盖率Compodoc和角
EN

Stack Overflow用户
提问于 2022-01-03 18:30:21
回答 1查看 201关注 0票数 1

正如标题说的那样,我使用的是有角度的compodoc,到目前为止它工作得很好。

我的问题在于代码覆盖率的计算。有办法修改这个计算吗?我不想记录每个变量的含义,如果我认为它们是不言自明的。我不想让一百万@忽略在我的代码中,因为我认为它的可读性会变差。

更重要的是,我想知道,是否有一种方法来表明我错过了什么。例如,compodoc说我的代码覆盖率很低,但是当我看我的代码时,我不知道我还能记录什么.

我遗漏了什么?

代码语言:javascript
复制
import { Component } 

from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';

/**
 * @description snackbar component can be used to alert the user of some circumstance
 * @class SnackbarComponent
 */
@Component({
  selector: 'app-snackbar',
  templateUrl: './snackbar.component.html',
  styleUrls: ['./snackbar.component.scss']
})



export class SnackbarComponent {

  /**
   * @description default class of Snackbarcomponent
   * @memberof SnackbarComponent
   */
  timeOut = 5000;



  /**
   * Creates an instance of SnackbarComponent.
   * @param {MatSnackBar} snackBar
   * @memberof SnackbarComponent
   */
  constructor(
    public snackBar: MatSnackBar
  ) { }


  /**
   * @description takes parameters and opens a small snackbar at the bottom right of the screen
   *
   * @param {string} message text of message
   * @param {string} [className=null] color of Snackbar e.g. "red-snackbar" "green-snackbar"
   * @param {string} [action=" "] Buttontext of Snackbar
   * @return {*}  In either case, a MatSnackBarRef is returned. This can be used to dismiss the snackbar or to receive notification of when the snackbar is dismissed
   * @memberof SnackbarComponent
   * 
   * @example:
   * let snackbarRef = openSnackBar("Hello World", "Accept", "green-snackbar")
   */
  openSnackBar(message: string, className: string = null, action: string = " ") {
    return this.snackBar.open(message, action, {
      duration: this.timeOut,
      verticalPosition: 'bottom',
      horizontalPosition: 'end',
      panelClass: [className],
    });
  }
}

`

EN

回答 1

Stack Overflow用户

发布于 2022-01-04 17:33:25

作为每一个为同一个问题而奋斗的人的tipp:

我发现compodoc不喜欢@description标签。只需将您的描述写为普通文本,而不需要显式标记。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70569989

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档