Я точно знаю, что вызов super()
в конструкторе вызовет branch not covered
, потому что машинописный текст его переносит.Проблема в том, как эта ошибка не отображается каждый раз?
У меня есть два класса:
class VastError extends Error {
public readonly code: VastErrorCodes;
constructor(code: VastErrorCodes) {
super(`Error parsing vast: ${code}`);
this.code = code;
Object.setPrototypeOf(this, VastError.prototype);
}
}
и
class LinearWrapper extends AbstractLinear {
constructor(element: Element) {
super(element);
}
}
(я пропустил реализациюподробно).В первом случае отчет о покрытии ветвь не покрывается, когда я звоню super(Error parsing vast: ${code});
Для второго класса нет.
Обратите внимание, что машинопись obv передает их таким же образом:
function VastError(code) {
var _this = _super.call(this, \"Error parsing vast: \" + code) || this;
_this.code = code;
Object.setPrototypeOf(_this, VastError.prototype);
return _this;
}
и
function LinearWrapper(element) {
var _this = _super.call(this, element) || this;
return _this;
}