File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed
Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " codify-plugin-lib" ,
3- "version" : " 1.0.149 " ,
3+ "version" : " 1.0.150 " ,
44 "description" : " Library plugin library" ,
55 "main" : " dist/index.js" ,
66 "typings" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -482,13 +482,12 @@ describe('Plugin tests', () => {
482482
483483 const testPlugin = Plugin . create ( 'testPlugin' , [ resource as any ] ) ;
484484
485- const validate1 = await testPlugin . validate ( {
486- configs : [ { core : { type : 'ssh-config' } , parameters : { propA : 'a' } } , {
487- core : { type : 'ssh-config' } ,
488- parameters : { propB : 'b' }
489- } ]
490- } )
491-
492- expect ( validate1 . resourceValidations . every ( ( r ) => r . isValid ) ) . to . be . false ;
485+ await expect ( ( ) => testPlugin . validate ( {
486+ configs : [ { core : { type : 'ssh-config' } , parameters : { propA : 'a' } } , {
487+ core : { type : 'ssh-config' } ,
488+ parameters : { propB : 'b' }
489+ } ]
490+ } )
491+ ) . rejects . toThrowError ( ) ;
493492 } )
494493} ) ;
Original file line number Diff line number Diff line change @@ -178,12 +178,11 @@ export class Plugin {
178178 } ) ;
179179
180180 if ( invalidMultipleConfigs . length > 0 ) {
181- validationResults . push ( ...invalidMultipleConfigs . map ( ( [ k , v ] ) => ( {
182- resourceType : k ,
183- schemaValidationErrors : [ ] ,
184- customValidationErrorMessage : `Multiple of resource type: ${ k } found in configs. Only allowed 1.` ,
185- isValid : false ,
186- } ) ) ) ;
181+ throw new Error (
182+ `Multiples of the following configs were found but only 1 is allowed.
183+
184+ [${ invalidMultipleConfigs . map ( ( [ k ] ) => k ) . join ( ', ' ) } ]
185+ ` )
187186 }
188187
189188 await this . crossValidateResources ( data . configs ) ;
You can’t perform that action at this time.
0 commit comments