add test ignores

This commit is contained in:
Michael C
2023-02-21 17:00:53 -05:00
parent e6f54f11f0
commit 900fa9f64e
2 changed files with 5 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ async function getFromRedis<T extends string>(key: HashedValue): Promise<T & Has
Logger.debug(`Got data from redis: ${reply}`);
return reply as T & HashedValue;
}
} catch (err) {
} catch (err) /* istanbul ignore next */ {
Logger.error(err as string);
}
}
@@ -37,7 +37,7 @@ async function getFromRedis<T extends string>(key: HashedValue): Promise<T & Has
const data = getHash(key, cachedHashTimes);
if (!config.redis?.disableHashCache) {
redis.set(redisKey, data).catch((err) => Logger.error(err));
redis.set(redisKey, data).catch(/* istanbul ignore next */ (err) => Logger.error(err));
}
return data as T & HashedValue;

View File

@@ -70,15 +70,16 @@ export async function getPlayerData (videoID: string, ignoreCache = false): Prom
}
try {
const data = await getFromITube(videoID)
.catch(err => {
.catch(/* istanbul ignore next */ err => {
Logger.warn(`InnerTube API Error for ${videoID}: ${err}`);
return Promise.reject(err);
});
DiskCache.set(cacheKey, data)
.then(() => Logger.debug(`InnerTube API: video information cache set for: ${videoID}`))
.catch((err: any) => Logger.warn(err));
.catch(/* istanbul ignore next */ (err: any) => Logger.warn(err));
return data;
} catch (err) {
/* istanbul ignore next */
return Promise.reject(err);
}
}