mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 06:48:04 +03:00
increase coverage by silencing unreachable statements
This commit is contained in:
+2
-1
@@ -73,7 +73,8 @@
|
||||
"src/*/!(test-utils)/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"src/**/*.test.ts"
|
||||
"src/**/*.test.ts",
|
||||
"src/external/mongo/schemas.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -32,11 +32,14 @@ import CreateLogCtx from "../../lib/logger/logger";
|
||||
|
||||
const logger = CreateLogCtx(__filename);
|
||||
|
||||
/* istanbul ignore next */
|
||||
const base = MONGO_BASE_URL ?? "127.0.0.1";
|
||||
|
||||
/* istanbul ignore next */
|
||||
const url = process.env.NODE_ENV === "test" ? `${base}:27017/testingdb` : `${base}:27017/ktblackdb`;
|
||||
|
||||
let dbtime: [number, number] = [0, 0];
|
||||
/* istanbul ignore next */
|
||||
if (process.env.NODE_ENV !== "test") {
|
||||
logger.info(`Connecting to database ${url}...`);
|
||||
dbtime = process.hrtime();
|
||||
@@ -46,6 +49,7 @@ export const monkDB = monk(url);
|
||||
|
||||
monkDB
|
||||
.then(() => {
|
||||
/* istanbul ignore next */
|
||||
if (process.env.NODE_ENV !== "test") {
|
||||
const time = process.hrtime(dbtime);
|
||||
const elapsed = time[0] + time[1] / 1e6;
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ export const RedisClient = redis.createClient();
|
||||
logger.verbose("Instantiated Redis Client");
|
||||
|
||||
function EmitCritical() {
|
||||
/* istanbul ignore next */
|
||||
if (!RedisClient.connected) {
|
||||
logger.crit(`Could not connect to redis in time. No more information is available.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user