From a62e5f198c1ee568acf9447b95c41b1b2792e8fc Mon Sep 17 00:00:00 2001 From: czlonkowski Date: Sat, 21 Mar 2026 22:22:02 +0100 Subject: [PATCH] fix: case-insensitive 'not found' assertions in API client tests N8nNotFoundError now passes through API messages directly instead of wrapping them. The n8n API returns "Not found" (capital N) but tests used .toContain('not found') (lowercase). Changed to case-insensitive. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/unit/services/n8n-api-client.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/services/n8n-api-client.test.ts b/tests/unit/services/n8n-api-client.test.ts index 0a87089..3ca8eaa 100644 --- a/tests/unit/services/n8n-api-client.test.ts +++ b/tests/unit/services/n8n-api-client.test.ts @@ -297,7 +297,7 @@ describe('N8nApiClient', () => { expect.fail('Should have thrown an error'); } catch (err) { expect(err).toBeInstanceOf(N8nNotFoundError); - expect((err as N8nNotFoundError).message).toContain('not found'); + expect((err as N8nNotFoundError).message.toLowerCase()).toContain('not found'); expect((err as N8nNotFoundError).statusCode).toBe(404); } }); @@ -380,7 +380,7 @@ describe('N8nApiClient', () => { expect.fail('Should have thrown an error'); } catch (err) { expect(err).toBeInstanceOf(N8nNotFoundError); - expect((err as N8nNotFoundError).message).toContain('not found'); + expect((err as N8nNotFoundError).message.toLowerCase()).toContain('not found'); expect((err as N8nNotFoundError).statusCode).toBe(404); } }); @@ -432,7 +432,7 @@ describe('N8nApiClient', () => { expect.fail('Should have thrown an error'); } catch (err) { expect(err).toBeInstanceOf(N8nNotFoundError); - expect((err as N8nNotFoundError).message).toContain('not found'); + expect((err as N8nNotFoundError).message.toLowerCase()).toContain('not found'); expect((err as N8nNotFoundError).statusCode).toBe(404); } }); @@ -501,7 +501,7 @@ describe('N8nApiClient', () => { expect.fail('Should have thrown an error'); } catch (err) { expect(err).toBeInstanceOf(N8nNotFoundError); - expect((err as N8nNotFoundError).message).toContain('not found'); + expect((err as N8nNotFoundError).message.toLowerCase()).toContain('not found'); expect((err as N8nNotFoundError).statusCode).toBe(404); } }); @@ -1278,7 +1278,7 @@ describe('N8nApiClient', () => { expect.fail('Should have thrown an error'); } catch (err) { expect(err).toBeInstanceOf(N8nNotFoundError); - expect((err as N8nNotFoundError).message).toContain('not found'); + expect((err as N8nNotFoundError).message.toLowerCase()).toContain('not found'); expect((err as N8nNotFoundError).statusCode).toBe(404); } });