From 02fcfa08c57cf045f1b94003e8a2a9162bdcf2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Tesa=C5=99?= Date: Wed, 27 Mar 2024 18:43:58 +0100 Subject: [PATCH 1/2] Clarify OIS processing tests --- src/ois.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ois.test.ts b/src/ois.test.ts index ef96ac8..ca14817 100644 --- a/src/ois.test.ts +++ b/src/ois.test.ts @@ -714,7 +714,7 @@ describe('API call skip validation', () => { ois.endpoints[0].preProcessingSpecificationV2 = { environment: 'Node', timeoutMs: 5000, - value: 'output = input;', + value: '({ response }) => { return { response: Math.round(Math.random() * 1000) } }', }; expect(() => oisSchema.parse(ois)).not.toThrow(); @@ -727,7 +727,7 @@ describe('API call skip validation', () => { ois.endpoints[0].postProcessingSpecificationV2 = { environment: 'Node', timeoutMs: 5000, - value: 'output = input;', + value: '({ response }) => { return { response: Math.round(Math.random() * 1000) } }', }; expect(() => oisSchema.parse(ois)).not.toThrow(); From 3a3a785098862da080058af0b20bd282a01ad8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Tesa=C5=99?= Date: Thu, 28 Mar 2024 15:34:41 +0100 Subject: [PATCH 2/2] Fix pre-processing value in test --- src/ois.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ois.test.ts b/src/ois.test.ts index ca14817..a4c9815 100644 --- a/src/ois.test.ts +++ b/src/ois.test.ts @@ -714,7 +714,7 @@ describe('API call skip validation', () => { ois.endpoints[0].preProcessingSpecificationV2 = { environment: 'Node', timeoutMs: 5000, - value: '({ response }) => { return { response: Math.round(Math.random() * 1000) } }', + value: "({ endpointParameters }) => { return { endpointParameters: {...endpointParameters, from: 'ETH'} }; }", }; expect(() => oisSchema.parse(ois)).not.toThrow();