mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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/src/lib/i18n';
|
||||
import * as lib from '@hydrooj/geoip/lib';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user