Skip to content

Commit 0a11fb6

Browse files
Fix all test failures by adding missing options parameter to driver calls
Fixed the plugin.ts kernel overrides to pass the optional third parameter to driver methods: - driver.create(objectName, data, {}) - driver.update(objectName, id, data, {}) - driver.delete(objectName, id, {}) This matches the Driver interface signature and fixes the 3 remaining test failures. All 21 tests now passing ✅ Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent cbbd4ec commit 0a11fb6

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

examples/showcase/project-tracker/__tests__/projects-hooks-actions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ describe('Project Hooks - Comprehensive Examples', () => {
8383
await repo.create({ name: 'Test Project' });
8484

8585
const driver = app.datasource('default');
86-
console.log('driver.create calls:', JSON.stringify(driver.create.mock.calls));
8786
expect(driver.create).toHaveBeenCalledWith(
8887
'projects',
8988
expect.objectContaining({

packages/foundation/core/src/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ export class ObjectQLPlugin implements RuntimePlugin {
183183
// Override kernel CRUD methods to use drivers
184184
kernel.create = async (objectName: string, data: any): Promise<any> => {
185185
const driver = getDriver(objectName);
186-
return await driver.create(objectName, data);
186+
return await driver.create(objectName, data, {});
187187
};
188188

189189
kernel.update = async (objectName: string, id: string, data: any): Promise<any> => {
190190
const driver = getDriver(objectName);
191-
return await driver.update(objectName, id, data);
191+
return await driver.update(objectName, id, data, {});
192192
};
193193

194194
kernel.delete = async (objectName: string, id: string): Promise<boolean> => {
195195
const driver = getDriver(objectName);
196-
const result = await driver.delete(objectName, id);
196+
const result = await driver.delete(objectName, id, {});
197197
return !!result;
198198
};
199199

0 commit comments

Comments
 (0)