Skip to content

Commit d96f78e

Browse files
Copilothotlong
andcommitted
Fix remaining driver and plugin test mock objects
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4510692 commit d96f78e

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

packages/spec/src/driver/driver.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,11 @@ describe('DriverInterfaceSchema', () => {
371371
checkHealth: async () => true,
372372
execute: async () => ({}),
373373
find: async () => [],
374+
findStream: async function* () {},
374375
findOne: async () => null,
375376
create: async () => ({}),
376377
update: async () => ({}),
378+
upsert: async () => ({}),
377379
delete: async () => true,
378380
count: async () => 0,
379381
bulkCreate: async () => [],
@@ -411,9 +413,11 @@ describe('DriverInterfaceSchema', () => {
411413
checkHealth: async () => true,
412414
execute: async () => ({}),
413415
find: async () => [],
416+
findStream: async function* () {},
414417
findOne: async () => null,
415418
create: async () => ({}),
416419
update: async () => ({}),
420+
upsert: async () => ({}),
417421
delete: async () => true,
418422
count: async () => 0,
419423
bulkCreate: async () => [],
@@ -453,9 +457,11 @@ describe('DriverInterfaceSchema', () => {
453457
checkHealth: async () => true,
454458
execute: async () => ({}),
455459
find: async (object, query) => [],
460+
findStream: async function* (object, query) {},
456461
findOne: async (object, query) => null,
457462
create: async (object, data) => data,
458463
update: async (object, id, data) => data,
464+
upsert: async (object, data) => data,
459465
delete: async (object, id) => true,
460466
count: async () => 0,
461467
bulkCreate: async (object, data) => data,
@@ -493,9 +499,11 @@ describe('DriverInterfaceSchema', () => {
493499
checkHealth: async () => true,
494500
execute: async () => ({}),
495501
find: async (object, query) => [],
502+
findStream: async function* (object, query) {},
496503
findOne: async (object, query) => null,
497504
create: async (object, data) => data,
498505
update: async (object, id, data) => data,
506+
upsert: async (object, data) => data,
499507
delete: async (object, id) => true,
500508
count: async () => 0,
501509
bulkCreate: async (object, data) => data,
@@ -533,9 +541,11 @@ describe('DriverInterfaceSchema', () => {
533541
checkHealth: async () => true,
534542
execute: async () => ({}),
535543
find: async (object, query) => [],
544+
findStream: async function* (object, query) {},
536545
findOne: async (object, query) => null,
537546
create: async (object, data) => data,
538547
update: async (object, id, data) => data,
548+
upsert: async (object, data) => data,
539549
delete: async (object, id) => true,
540550
count: async () => 0,
541551
bulkCreate: async (object, data) => data,
@@ -573,9 +583,11 @@ describe('DriverInterfaceSchema', () => {
573583
checkHealth: async () => true,
574584
execute: async () => ({}),
575585
find: async (object, query) => [],
586+
findStream: async function* (object, query) {},
576587
findOne: async (object, query) => null,
577588
create: async (object, data) => data,
578589
update: async (object, id, data) => data,
590+
upsert: async (object, data) => data,
579591
delete: async (object, id) => true,
580592
count: async () => 0,
581593
bulkCreate: async (object, data) => data,
@@ -613,9 +625,11 @@ describe('DriverInterfaceSchema', () => {
613625
checkHealth: async () => true,
614626
execute: async () => ({}),
615627
find: async (object, query) => [],
628+
findStream: async function* (object, query) {},
616629
findOne: async (object, query) => null,
617630
create: async (object, data) => data,
618631
update: async (object, id, data) => data,
632+
upsert: async (object, data) => data,
619633
delete: async (object, id) => true,
620634
count: async () => 0,
621635
bulkCreate: async (object, data) => data,

packages/spec/src/kernel/plugin.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ describe('PluginContextSchema', () => {
4242
post: () => {},
4343
use: () => {}
4444
}
45+
},
46+
drivers: {
47+
register: () => {}
4548
}
4649
};
4750

@@ -81,6 +84,9 @@ describe('PluginContextSchema', () => {
8184
post: () => {},
8285
use: () => {}
8386
}
87+
},
88+
drivers: {
89+
register: () => {}
8490
}
8591
};
8692

@@ -130,6 +136,9 @@ describe('PluginContextSchema', () => {
130136
post: (path: string, handler: Function) => {},
131137
use: (pathOrHandler: string | Function, handler?: Function) => {}
132138
}
139+
},
140+
drivers: {
141+
register: (driver: any) => {}
133142
}
134143
};
135144

0 commit comments

Comments
 (0)