Skip to content

Commit

Permalink
test(definitions): http security tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Jun 15, 2024
1 parent 66bcced commit 1e10bff
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions test/definitions/3.0.0/security/http/http.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ import {describe, it} from 'vitest';
import TestHelper from '@test/test-helper';
import path from 'path';

describe.each([
{
name: 'API key',
json: {
"type": "httpApiKey",
"description": "httpApiKey",
"name": "api_key",
"in": "header"
}
},
{
name: 'Basic',
json: {
"type": "http",
"description": "http",
"scheme": "basic"
}
},
{
name: 'Bearer',
json: {
"type": "http",
"description": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
])('HTTP Security: ', async (httpSecurity) => {
describe('HTTP Security Scheme', async (httpSecurity) => {
const httpSecurityScheme = await import('@definitions/3.0.0/HTTPSecurityScheme.json');

it(`oneOf recognize: ${httpSecurity.name}`, () => TestHelper.objectIsValid(
it.each([
{
name: 'API key',
json: {
"type": "httpApiKey",
"description": "httpApiKey",
"name": "api_key",
"in": "header"
}
},
{
name: 'Basic',
json: {
"type": "http",
"description": "http",
"scheme": "basic"
}
},
{
name: 'Bearer',
json: {
"type": "http",
"description": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
])('oneOf recognize: $name', (httpSecurity) => TestHelper.objectIsValid(
httpSecurityScheme,
httpSecurity.json,
));
Expand Down

0 comments on commit 1e10bff

Please sign in to comment.