chore: Switch coverage from istanbul to the v8 provider for speed (#2619)
This commit is contained in:
@@ -67,7 +67,7 @@ export class PTZDigitalAction extends AdvancedCameraCardAction<PTZDigitialAction
|
||||
return await this._stepChange(api, targetID);
|
||||
}
|
||||
|
||||
/* istanbul ignore else: the else path cannot be reached -- @preserve */
|
||||
/* v8 ignore else: the else path cannot be reached -- @preserve */
|
||||
if (action.ptz_phase === 'start') {
|
||||
await stopInProgressForThisTarget(targetID, this._context.ptzDigital);
|
||||
setInProgressForThisTarget(targetID, this._context, 'ptzDigital', this);
|
||||
|
||||
@@ -99,7 +99,7 @@ export class PTZAction extends AdvancedCameraCardAction<PTZActionConfig> {
|
||||
setInProgressForThisTarget(ptzCameraID, this._context, 'ptz', this);
|
||||
|
||||
const singleStep = async (): Promise<void> => {
|
||||
/* istanbul ignore else: the else path cannot be reached as ptz_action
|
||||
/* v8 ignore else: the else path cannot be reached as ptz_action
|
||||
being present is checked above -- @preserve */
|
||||
if (action.ptz_action) {
|
||||
await api.getCameraManager().executePTZAction(ptzCameraID, action.ptz_action, {
|
||||
@@ -133,7 +133,7 @@ export class PTZAction extends AdvancedCameraCardAction<PTZActionConfig> {
|
||||
});
|
||||
|
||||
this._timer.start(ptzConfiguration.c2r_delay_between_calls_seconds, async () => {
|
||||
/* istanbul ignore else: the else path cannot be reached as ptz_action
|
||||
/* v8 ignore else: the else path cannot be reached as ptz_action
|
||||
being present is checked above -- @preserve */
|
||||
if (action.ptz_action) {
|
||||
await api.getCameraManager().executePTZAction(ptzCameraID, action.ptz_action, {
|
||||
|
||||
@@ -53,7 +53,7 @@ export abstract class GeneratedTone implements Tone {
|
||||
// Current AudioContext time. Subclasses only read this from inside `_play()`
|
||||
// where the context is always set.
|
||||
protected get _currentTime(): number {
|
||||
/* istanbul ignore next: _currentTime is only read by subclasses from
|
||||
/* v8 ignore next: _currentTime is only read by subclasses from
|
||||
_play() during an active context -- @preserve */
|
||||
return this._context?.currentTime ?? 0;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export abstract class GeneratedTone implements Tone {
|
||||
// of their pattern to loop. No-ops if the context has already been closed so
|
||||
// a stopped tone can never re-arm its loop.
|
||||
protected _scheduleNext(intervalSeconds: number): void {
|
||||
/* istanbul ignore next: defensive guard against a subclass calling
|
||||
/* v8 ignore next: defensive guard against a subclass calling
|
||||
_scheduleNext after stop() -- JS single-threading makes this unreachable
|
||||
from the existing subclasses -- @preserve */
|
||||
if (!this._context) {
|
||||
@@ -78,7 +78,7 @@ export abstract class GeneratedTone implements Tone {
|
||||
return;
|
||||
}
|
||||
this._timer.start(intervalSeconds, () => {
|
||||
/* istanbul ignore next: Timer.stop() cancels pending callbacks, so this
|
||||
/* v8 ignore next: Timer.stop() cancels pending callbacks, so this
|
||||
re-entry guard is unreachable in practice -- @preserve */
|
||||
if (!this._context) {
|
||||
return;
|
||||
@@ -89,7 +89,7 @@ export abstract class GeneratedTone implements Tone {
|
||||
|
||||
// Plays one note: a smooth tone that rises to peak volume and then fades.
|
||||
protected _playNote(freq: number, when: number, envelope: ToneEnvelope): void {
|
||||
/* istanbul ignore next: _playNote is only called by subclasses from
|
||||
/* v8 ignore next: _playNote is only called by subclasses from
|
||||
_play() during an active context -- @preserve */
|
||||
if (!this._context) {
|
||||
return;
|
||||
|
||||
@@ -51,7 +51,7 @@ export class CustomTone implements Tone {
|
||||
}
|
||||
|
||||
private _handleEnded = (): void => {
|
||||
/* istanbul ignore next: stop() removes this listener before nulling
|
||||
/* v8 ignore next: stop() removes this listener before nulling
|
||||
_audio, so the handler can't fire with a null _audio -- @preserve */
|
||||
if (!this._audio) {
|
||||
return;
|
||||
@@ -64,7 +64,7 @@ export class CustomTone implements Tone {
|
||||
};
|
||||
|
||||
private _playAudio(): void {
|
||||
/* istanbul ignore next: callers (start, _handleEnded) only invoke
|
||||
/* v8 ignore next: callers (start, _handleEnded) only invoke
|
||||
_playAudio when _audio is non-null -- @preserve */
|
||||
if (!this._audio) {
|
||||
return;
|
||||
|
||||
@@ -242,7 +242,7 @@ export class CameraTriggersManager {
|
||||
} else if (ev.fidelity === 'high' && triggerAction === 'media') {
|
||||
// Choose the most appropriate media view based on what's available.
|
||||
// Priority: review > clip > snapshot
|
||||
/* istanbul ignore next: the `null` case is unreachable due to `skipViewAction` above -- @preserve */
|
||||
/* v8 ignore next: the `null` case is unreachable due to `skipViewAction` above -- @preserve */
|
||||
const view = ev.review
|
||||
? 'review'
|
||||
: ev.clip
|
||||
@@ -251,7 +251,7 @@ export class CameraTriggersManager {
|
||||
? 'snapshot'
|
||||
: null;
|
||||
|
||||
/* istanbul ignore next: unreachable due to `skipViewAction` above -- @preserve */
|
||||
/* v8 ignore next: unreachable due to `skipViewAction` above -- @preserve */
|
||||
if (view) {
|
||||
await this._api.getViewManager().setViewByParametersWithNewQuery({
|
||||
params: {
|
||||
|
||||
@@ -163,7 +163,7 @@ export class ConfigManager {
|
||||
}
|
||||
|
||||
private _processOverrideConfig(): void {
|
||||
/* istanbul ignore if: No (current) way to reach this code -- @preserve */
|
||||
/* v8 ignore if: No (current) way to reach this code -- @preserve */
|
||||
if (!this._config) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class ViewItemManager {
|
||||
try {
|
||||
await this._download(item);
|
||||
} catch (error: unknown) {
|
||||
/* istanbul ignore if: catch always provides a non-null error -- @preserve */
|
||||
/* v8 ignore if: catch always provides a non-null error -- @preserve */
|
||||
if (error == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export class ViewItemManager {
|
||||
if (source === ViewMediaSource.Camera && ViewItemClassifier.isMedia(item)) {
|
||||
return await this._api.getCameraManager().favoriteMedia(item, favorite);
|
||||
}
|
||||
/* istanbul ignore else: this path cannot be reached -- @preserve */
|
||||
/* v8 ignore else: this path cannot be reached -- @preserve */
|
||||
if (source === ViewMediaSource.Folder) {
|
||||
return this._api.getFoldersManager().favorite(item, favorite);
|
||||
}
|
||||
@@ -78,7 +78,6 @@ export class ViewItemManager {
|
||||
return ViewMediaSource.Folder;
|
||||
}
|
||||
|
||||
/* istanbul ignore next: this path cannot be reached -- @preserve */
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -133,12 +132,12 @@ export class ViewItemManager {
|
||||
);
|
||||
}
|
||||
|
||||
/* istanbul ignore else: this path cannot be reached -- @preserve */
|
||||
/* v8 ignore else: this path cannot be reached -- @preserve */
|
||||
if (ViewItemClassifier.isFolder(item)) {
|
||||
return toFilename(item.getTitle() ?? 'media');
|
||||
}
|
||||
|
||||
/* istanbul ignore next: this path cannot be reached -- @preserve */
|
||||
/* v8 ignore next: this path cannot be reached -- @preserve */
|
||||
return 'download';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ export class ViewManager implements ViewManagerInterface {
|
||||
return;
|
||||
}
|
||||
|
||||
/* istanbul ignore if: the if path cannot be reached as the view is set
|
||||
/* v8 ignore if: the if path cannot be reached as the view is set
|
||||
above -- @preserve */
|
||||
if (!this._view) {
|
||||
return;
|
||||
|
||||
@@ -227,7 +227,7 @@ export class ViewQueryExecutor {
|
||||
const now = new Date();
|
||||
const liveConfig = this._api.getConfigManager().getConfig()?.live;
|
||||
|
||||
/* istanbul ignore if: this if branch cannot be reached as if the config is
|
||||
/* v8 ignore if: this if branch cannot be reached as if the config is
|
||||
empty this function is never called -- @preserve */
|
||||
if (!liveConfig) {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user