fix: complete Phase 4 integration test fixes

- Fixed better-sqlite3 ES module imports across all tests
- Updated template repository method to handle undefined results
- Fixed all database column references to match schema
- Corrected MCP transport initialization
- All integration tests now passing
This commit is contained in:
czlonkowski
2025-07-29 12:46:55 +02:00
parent 11675cccd9
commit c824fb5ebf
8 changed files with 530 additions and 245 deletions

View File

@@ -91,6 +91,20 @@ export class TestableN8NMCPServer {
async connectToTransport(transport: Transport): Promise<void> {
this.transport = transport;
// Ensure transport has required properties before connecting
if (!transport || typeof transport !== 'object') {
throw new Error('Invalid transport provided');
}
// Set up any missing transport handlers to prevent "Cannot set properties of undefined" errors
if (transport && typeof transport === 'object') {
const transportAny = transport as any;
if (transportAny.serverTransport && !transportAny.serverTransport.onclose) {
transportAny.serverTransport.onclose = () => {};
}
}
await this.server.connect(transport);
}