Skip to content

Commit

Permalink
AN-614: Test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
acenolaza committed May 19, 2022
1 parent 82cc216 commit e236447
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/airnode-validator/src/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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],
},
])
);
Expand Down

0 comments on commit e236447

Please sign in to comment.