mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
spec: update mock
This commit is contained in:
1 parent
daa5bffd8c
commit
c49970f4be
3 files changed
+3
-3
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
export * from '../packages/hydrooj/src/loader';
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
jest.mock('hydrooj/src/loader');
|
|
||||||
import 'hydrooj';
|
import 'hydrooj';
|
||||||
import 'hydrooj/src/lib/i18n';
|
import 'hydrooj/src/lib/i18n';
|
||||||
import * as lib from '@hydrooj/geoip/lib';
|
import * as lib from '@hydrooj/geoip/lib';
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import * as db from '../service/db';
|
|||||||
|
|
||||||
export const coll = db.collection('oplog');
|
export const coll = db.collection('oplog');
|
||||||
|
|
||||||
export async function add(data: Partial<OplogDoc>): Promise<ObjectID> {
|
export async function add(data: Partial<OplogDoc> & { type: string }): Promise<ObjectID> {
|
||||||
const res = await coll.insertOne(data);
|
const res = await coll.insertOne({ _id: new ObjectID(), ...data });
|
||||||
return res.insertedId;
|
return res.insertedId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user