Skip to content

Commit

Permalink
Add test for unsupported open api version
Browse files Browse the repository at this point in the history
  • Loading branch information
satazor committed Aug 2, 2024
1 parent 32fc75d commit 210ff0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/parser/spec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ describe('validateSpec()', () => {
);
});

it('should throw for unsupported OpenAPI versions', async () => {
const spec = {
info: {},
openapi: '2.0.0',
paths: {}
};

await expect(validateSpec({ spec })).rejects.toThrowError(/Unsupported OpenAPI version: 2\.0\.0/);
});

it('should return a parsed spec', async () => {
const spec = {
info: {
Expand Down

0 comments on commit 210ff0b

Please sign in to comment.