正如标题所说,我正在将 compodoc 与 Angular 一起使用,到目前为止它运行良好。
我的问题在于代码覆盖率的计算。有没有办法修改这个计算?如果我认为它们是不言自明的,我不想记录每个变量的含义。而且我不希望我的代码中有一百万个@ignores,因为我认为它的可读性会降低。
此外,我很想知道,是否有办法显示我所缺少的。例如, 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],
});
}
}
`