Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lag-of-death committed Sep 4, 2019
1 parent 5667936 commit 7422943
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/rulesets/__tests__/shared/_parameter-description.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default (s: any) => {
import { Spectral } from '../../../spectral';

export default (s: Spectral, oasVersion: number) => {
test('should work for shared level parameters', async () => {
const results = await s.run({
swagger: '2.0',
Expand Down Expand Up @@ -71,7 +73,7 @@ export default (s: any) => {
});
expect(results).toEqual([
expect.objectContaining({
code: 'parameter-description',
code: `oas${oasVersion}-parameter-description`,
message: 'Parameter objects should have a `description`.',
path: ['paths', '/todos', 'parameters', '0'],
severity: 1,
Expand All @@ -98,7 +100,7 @@ export default (s: any) => {
});
expect(results).toEqual([
expect.objectContaining({
code: 'parameter-description',
code: `oas${oasVersion}-parameter-description`,
message: 'Parameter objects should have a `description`.',
path: ['paths', '/todos', 'get', 'parameters', '0'],
severity: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/oas2/__tests__/oas2-parameter-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('oas2-parameter-description', () => {
}),
});

testParameterDescription(s);
testParameterDescription(s, 2);

test('return errors if shared level parameter description is missing', async () => {
const results = await s.run({
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/oas3/__tests__/oas3-parameter-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('oas3-parameter-description', () => {
}),
});

testParameterDescription(s);
testParameterDescription(s, 3);

describe('$.components.parameters', () => {
it('validates description', async () => {
Expand Down

0 comments on commit 7422943

Please sign in to comment.