From 8e49013d72a282224a267cff0b70ac1ecab5e2d3 Mon Sep 17 00:00:00 2001 From: czlonkowski Date: Thu, 26 Mar 2026 15:40:52 +0100 Subject: [PATCH] fix: update community integration test mock for INSERT OR REPLACE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mock SQL matching used 'INSERT INTO nodes' which doesn't match 'INSERT OR REPLACE INTO nodes'. Also added handler for the new SELECT npm_readme query in saveNode. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-Authored-By: Claude --- .../community/community-nodes-integration.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/community/community-nodes-integration.test.ts b/tests/integration/community/community-nodes-integration.test.ts index 2ac1b85..9216237 100644 --- a/tests/integration/community/community-nodes-integration.test.ts +++ b/tests/integration/community/community-nodes-integration.test.ts @@ -87,7 +87,7 @@ class InMemoryDatabaseAdapter implements DatabaseAdapter { class InMemoryPreparedStatement implements PreparedStatement { run = vi.fn((...params: any[]): RunResult => { - if (this.sql.includes('INSERT INTO nodes')) { + if (this.sql.includes('INSERT') && this.sql.includes('INTO nodes')) { const node = this.paramsToNode(params); this.adapter.saveNode(node); return { changes: 1, lastInsertRowid: 1 }; @@ -100,6 +100,9 @@ class InMemoryPreparedStatement implements PreparedStatement { }); get = vi.fn((...params: any[]) => { + if (this.sql.includes('SELECT npm_readme')) { + return undefined; // No existing docs to preserve + } if (this.sql.includes('SELECT * FROM nodes WHERE node_type = ?')) { return this.adapter.getNode(params[0]); }