From 757c5f259b4711055ca7ae66cf6ac75485a4a593 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 11 Sep 2021 14:18:02 -0400 Subject: Upgrade packages and fix unit tests --- src/util/config.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/util/config.test.ts') diff --git a/src/util/config.test.ts b/src/util/config.test.ts index a065c47..7506840 100644 --- a/src/util/config.test.ts +++ b/src/util/config.test.ts @@ -8,7 +8,7 @@ import { handleStartup, handleShutdown } from "./config"; -import { MongoClient, MongoError } from "mongodb"; +import { MongoClient, MongoError, ReadPreference } from "mongodb"; import { Server } from "http"; import path from "path"; import fs from "fs"; @@ -42,6 +42,14 @@ const MongoMock = (p: Promise): jest.Mock => jest.fn(() => ({ ...CommonMocks, close: jest.fn(() => p), + readPreference: { + mode: ReadPreference.NEAREST, + tags: [], + isValid: jest.fn(), + slaveOk: jest.fn(), + equals: jest.fn() + }, + writeConcern: {}, db: jest.fn() })); const ServerMock = (mockErr: Error | undefined): jest.Mock => @@ -63,6 +71,7 @@ const ServerMock = (mockErr: Error | undefined): jest.Mock => address: jest.fn(), getConnections: jest.fn(), ref: jest.fn(), + requestTimeout: 3600, unref: jest.fn() })); -- cgit