@@ -3,6 +3,7 @@ const resolver = require('json-schema-ref-parser');
33const {
44 validate
55} = require ( '../../../../src/plugins/validation/2and3/semantic-validators/operation-ids' ) ;
6+ const config = require ( '../../../../src/.defaultsForValidator' ) . defaults . shared ;
67
78describe ( 'validation plugin - semantic - operation-ids' , function ( ) {
89 it ( 'should complain about a repeated operationId in the same path' , function ( ) {
@@ -21,7 +22,7 @@ describe('validation plugin - semantic - operation-ids', function() {
2122 }
2223 } ;
2324
24- const res = validate ( { resolvedSpec : spec } ) ;
25+ const res = validate ( { resolvedSpec : spec } , config ) ;
2526 expect ( res . errors . length ) . toEqual ( 1 ) ;
2627 expect ( res . errors [ 0 ] . path ) . toEqual ( 'paths./coolPath.get.operationId' ) ;
2728 expect ( res . errors [ 0 ] . message ) . toEqual ( 'operationIds must be unique' ) ;
@@ -50,7 +51,7 @@ describe('validation plugin - semantic - operation-ids', function() {
5051 }
5152 } ;
5253
53- const res = validate ( { resolvedSpec : spec } ) ;
54+ const res = validate ( { resolvedSpec : spec } , config ) ;
5455 expect ( res . errors . length ) . toEqual ( 1 ) ;
5556 expect ( res . errors [ 0 ] . path ) . toEqual ( 'paths./greatPath.put.operationId' ) ;
5657 expect ( res . errors [ 0 ] . message ) . toEqual ( 'operationIds must be unique' ) ;
@@ -91,7 +92,7 @@ describe('validation plugin - semantic - operation-ids', function() {
9192
9293 const resolvedSpec = await resolver . dereference ( spec ) ;
9394
94- const res = validate ( { resolvedSpec } ) ;
95+ const res = validate ( { resolvedSpec } , config ) ;
9596 expect ( res . errors . length ) . toEqual ( 1 ) ;
9697 expect ( res . errors [ 0 ] . path ) . toEqual ( 'paths./greatPath.get.operationId' ) ;
9798 expect ( res . errors [ 0 ] . message ) . toEqual ( 'operationIds must be unique' ) ;
@@ -164,7 +165,7 @@ describe('validation plugin - semantic - operation-ids', function() {
164165 } ;
165166
166167 const resolvedSpec = await resolver . dereference ( spec ) ;
167- const res = validate ( { resolvedSpec } ) ;
168+ const res = validate ( { resolvedSpec } , config ) ;
168169
169170 expect ( res . errors . length ) . toEqual ( 0 ) ;
170171 expect ( res . warnings . length ) . toEqual ( 12 ) ;
@@ -243,7 +244,7 @@ describe('validation plugin - semantic - operation-ids', function() {
243244 } ;
244245
245246 const resolvedSpec = await resolver . dereference ( spec ) ;
246- const res = validate ( { resolvedSpec } ) ;
247+ const res = validate ( { resolvedSpec } , config ) ;
247248
248249 expect ( res . errors . length ) . toEqual ( 0 ) ;
249250 expect ( res . warnings . length ) . toEqual ( 0 ) ;
0 commit comments