File tree Expand file tree Collapse file tree
graphql/test/__mocks__/@objectstack
json-rpc/test/__mocks__/@objectstack
odata-v4/test/__mocks__/@objectstack
rest/test/__mocks__/@objectstack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,25 @@ export class ObjectKernel {
114114 }
115115 }
116116
117+ async stop ( ) : Promise < void > {
118+ // Mock implementation that calls plugin lifecycle methods
119+ for ( const plugin of this . plugins ) {
120+ if ( plugin . onStop ) {
121+ await plugin . onStop ( { engine : this } ) ;
122+ }
123+ }
124+ }
125+
126+ getDriver ( ) : any {
127+ // Return the first driver-like plugin (typically MemoryDriver, SQLDriver, etc.)
128+ // Drivers usually don't have an 'install' method or have specific driver methods
129+ const driver = this . plugins . find ( p =>
130+ p . constructor . name ?. includes ( 'Driver' ) ||
131+ ( typeof p . find === 'function' && typeof p . create === 'function' )
132+ ) ;
133+ return driver || this . driver ;
134+ }
135+
117136 async seed ( ) : Promise < void > {
118137 // Mock implementation
119138 }
Original file line number Diff line number Diff line change @@ -114,6 +114,25 @@ export class ObjectKernel {
114114 }
115115 }
116116
117+ async stop ( ) : Promise < void > {
118+ // Mock implementation that calls plugin lifecycle methods
119+ for ( const plugin of this . plugins ) {
120+ if ( plugin . onStop ) {
121+ await plugin . onStop ( { engine : this } ) ;
122+ }
123+ }
124+ }
125+
126+ getDriver ( ) : any {
127+ // Return the first driver-like plugin (typically MemoryDriver, SQLDriver, etc.)
128+ // Drivers usually don't have an 'install' method or have specific driver methods
129+ const driver = this . plugins . find ( p =>
130+ p . constructor . name ?. includes ( 'Driver' ) ||
131+ ( typeof p . find === 'function' && typeof p . create === 'function' )
132+ ) ;
133+ return driver || this . driver ;
134+ }
135+
117136 async seed ( ) : Promise < void > {
118137 // Mock implementation
119138 }
Original file line number Diff line number Diff line change @@ -114,6 +114,25 @@ export class ObjectKernel {
114114 }
115115 }
116116
117+ async stop ( ) : Promise < void > {
118+ // Mock implementation that calls plugin lifecycle methods
119+ for ( const plugin of this . plugins ) {
120+ if ( plugin . onStop ) {
121+ await plugin . onStop ( { engine : this } ) ;
122+ }
123+ }
124+ }
125+
126+ getDriver ( ) : any {
127+ // Return the first driver-like plugin (typically MemoryDriver, SQLDriver, etc.)
128+ // Drivers usually don't have an 'install' method or have specific driver methods
129+ const driver = this . plugins . find ( p =>
130+ p . constructor . name ?. includes ( 'Driver' ) ||
131+ ( typeof p . find === 'function' && typeof p . create === 'function' )
132+ ) ;
133+ return driver || this . driver ;
134+ }
135+
117136 async seed ( ) : Promise < void > {
118137 // Mock implementation
119138 }
Original file line number Diff line number Diff line change @@ -123,6 +123,16 @@ export class ObjectKernel {
123123 }
124124 }
125125
126+ getDriver ( ) : any {
127+ // Return the first driver-like plugin (typically MemoryDriver, SQLDriver, etc.)
128+ // Drivers usually don't have an 'install' method or have specific driver methods
129+ const driver = this . plugins . find ( p =>
130+ p . constructor . name ?. includes ( 'Driver' ) ||
131+ ( typeof p . find === 'function' && typeof p . create === 'function' )
132+ ) ;
133+ return driver || this . driver ;
134+ }
135+
126136 async seed ( ) : Promise < void > {
127137 // Mock implementation
128138 }
You can’t perform that action at this time.
0 commit comments