From e236447247d968f88885d10d44262a4ed9346f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Ace=C3=B1olaza?= Date: Thu, 19 May 2022 11:10:13 -0300 Subject: [PATCH] AN-614: Test cleanup --- .../airnode-validator/src/config/config.test.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/airnode-validator/src/config/config.test.ts b/packages/airnode-validator/src/config/config.test.ts index bee2207402..72adb9b1b1 100644 --- a/packages/airnode-validator/src/config/config.test.ts +++ b/packages/airnode-validator/src/config/config.test.ts @@ -83,14 +83,7 @@ it('fails if a securitySchemeName is enabled and it is of type "apiKey" or "http name: 'access_key', }, }; - const apiCredentials = [ - { - oisTitle: 'Currency Converter API', - securitySchemeName: 'Currency Converter Security Scheme', - securitySchemeValue: '${SS_CURRENCY_CONVERTER_API_KEY}', - }, - ]; - const configWithSecuritySchemes = { + const invalidConfig = { ...config, ois: [ ...config.ois, @@ -103,19 +96,15 @@ it('fails if a securitySchemeName is enabled and it is of type "apiKey" or "http }, }, ], - apiCredentials, - }; - - const invalidConfig = { - ...configWithSecuritySchemes, apiCredentials: [], }; + expect(() => configSchema.parse(invalidConfig)).toThrow( new ZodError([ { code: 'custom', message: 'The security scheme is enabled but no credentials are provided in "apiCredentials"', - path: ['ois', 1, 'apiSpecifications', 'security', 'Currency Converter Security Scheme'], + path: ['ois', 1, 'apiSpecifications', 'security', securitySchemeName], }, ]) );