正如标题说的那样,我使用的是有角度的compodoc,到目前为止它工作得很好。
我的问题在于代码覆盖率的计算。有办法修改这个计算吗?我不想记录每个变量的含义,如果我认为它们是不言自明的。我不想让一百万@忽略在我的代码中,因为我认为它的可读性会变差。
更重要的是,我想知道,是否有一种方法来表明我错过了什么。例如,compodoc说我的代码覆盖率很低,但是当我看我的代码时,我不知道我还能记录什么.
我遗漏了什么?
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],
});
}
}`
发布于 2022-01-04 17:33:25
作为每一个为同一个问题而奋斗的人的tipp:
我发现compodoc不喜欢@description标签。只需将您的描述写为普通文本,而不需要显式标记。
https://stackoverflow.com/questions/70569989
复制相似问题