spec: update mock

This commit is contained in:
undefined committed 2020-10-05 20:54:23 +08:00
1 parent daa5bffd8c
commit c49970f4be
3 files changed
+3 -3

No files matched your search

+1
View File
@@ -0,0 +1 @@
export * from '../packages/hydrooj/src/loader';
-1
View File
@@ -1,4 +1,3 @@
jest.mock('hydrooj/src/loader');
import 'hydrooj';
import 'hydrooj/src/lib/i18n';
import * as lib from '@hydrooj/geoip/lib';
+2 -2
View File
@@ -4,8 +4,8 @@ import * as db from '../service/db';
export const coll = db.collection('oplog');
export async function add(data: Partial<OplogDoc>): Promise<ObjectID> {
const res = await coll.insertOne(data);
export async function add(data: Partial<OplogDoc> & { type: string }): Promise<ObjectID> {
const res = await coll.insertOne({ _id: new ObjectID(), ...data });
return res.insertedId;
}