Skip to content

Commit

Permalink
fix: added test for url parameters in genPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyifang authored and SkeLLLa committed Aug 20, 2020
1 parent 6c336e4 commit 6a19600
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions __tests__/lib/helpers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,29 @@ describe('helpers', () => {
helpers.genPath(dst, params);
expect(dst).toEqual(expected);
});
test('generates valid url params', () => {
const dst = [];
const expected = [
{
description: 'user id',
in: 'query',
name: 'id',
schema: { description: 'user id', type: 'string' },
},
];
const params = {
type: 'object',
properties: {
id: {
in: 'query',
type: 'string',
description: 'user id',
},
},
};
helpers.genPath(dst, params);
expect(dst).toEqual(expected);
});
});

describe('genResponse', () => {
Expand Down

0 comments on commit 6a19600

Please sign in to comment.