@@ -566,9 +566,40 @@ describe('triggers', () => {
566
566
} ) . toThrow ( / m a x i m u m l e n g t h o f f i l e P a t h s I n c l u d e s i n p u s h F i l t e r f o r s o u r c e A c t i o n w i t h n a m e ' C o d e S t a r C o n n e c t i o n s S o u r c e A c t i o n ' i s 8 , g o t 9 / ) ;
567
567
} ) ;
568
568
569
- // TODO: implements and add tests
570
- // 1. tags and branches (with filePaths) are mutually exclusive
571
- // 2. filePaths without branches is not allowed
569
+ test ( 'throw if tags and branches are specified' , ( ) => {
570
+ expect ( ( ) => {
571
+ new codepipeline . Pipeline ( stack , 'Pipeline' , {
572
+ pipelineType : codepipeline . PipelineType . V2 ,
573
+ triggers : [ {
574
+ providerType : codepipeline . ProviderType . CODE_STAR_SOURCE_CONNECTION ,
575
+ gitConfiguration : {
576
+ sourceAction,
577
+ pushFilter : [ {
578
+ tagsExcludes : [ 'exclude1' , 'exclude2' ] ,
579
+ branchesExcludes : [ 'exclude1' , 'exclude2' ] ,
580
+ } ] ,
581
+ } ,
582
+ } ] ,
583
+ } ) ;
584
+ } ) . toThrow ( / c a n n o t s p e c i f y b o t h t a g s a n d b r a n c h e s i n p u s h F i l t e r f o r s o u r c e A c t i o n w i t h n a m e ' C o d e S t a r C o n n e c t i o n s S o u r c e A c t i o n ' i s 8 , g o t 9 / ) ;
585
+ } ) ;
586
+
587
+ test ( 'throw if filePaths without branches is specified' , ( ) => {
588
+ expect ( ( ) => {
589
+ new codepipeline . Pipeline ( stack , 'Pipeline' , {
590
+ pipelineType : codepipeline . PipelineType . V2 ,
591
+ triggers : [ {
592
+ providerType : codepipeline . ProviderType . CODE_STAR_SOURCE_CONNECTION ,
593
+ gitConfiguration : {
594
+ sourceAction,
595
+ pushFilter : [ {
596
+ filePathsExcludes : [ 'exclude1' , 'exclude2' ] ,
597
+ } ] ,
598
+ } ,
599
+ } ] ,
600
+ } ) ;
601
+ } ) . toThrow ( / c a n n o t s p e c i f y f i l e P a t h s w i t h o u t b r a n c h e s i n p u s h F i l t e r f o r s o u r c e A c t i o n w i t h n a m e ' C o d e S t a r C o n n e c t i o n s S o u r c e A c t i o n ' i s 8 , g o t 9 / ) ;
602
+ } ) ;
572
603
573
604
test ( 'empty pushFilter for trigger is set to undefined' , ( ) => {
574
605
const pipeline = new codepipeline . Pipeline ( stack , 'Pipeline' , {
0 commit comments