@@ -35,6 +35,18 @@ describe('controller inheritance', () => {
3535 // Build controllers
3636 const metadataBuilder = new MetadataBuilder ( { } ) ;
3737 const meta = metadataBuilder . buildControllerMetadata ( [ DerivativeController ] ) ;
38+ const storage = getMetadataArgsStorage ( ) ;
39+
40+ expect ( storage . controllers [ 0 ] . target ) . to . be . eq ( DerivativeController ) ;
41+ expect ( storage . controllers [ 0 ] . route ) . to . be . eq ( '/derivative' ) ;
42+ expect ( storage . controllers [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
43+ expect ( storage . controllers [ 1 ] . route ) . to . be . eq ( '/autonomous' ) ;
44+ expect ( storage . actions [ 0 ] . target ) . to . be . eq ( DerivativeController ) ;
45+ expect ( storage . actions [ 0 ] . type ) . to . be . eq ( 'post' ) ;
46+ expect ( storage . actions [ 0 ] . method ) . to . be . eq ( 'create' ) ;
47+ expect ( storage . actions [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
48+ expect ( storage . actions [ 1 ] . type ) . to . be . eq ( 'post' ) ;
49+ expect ( storage . actions [ 1 ] . method ) . to . be . eq ( 'create' ) ;
3850
3951 expect ( meta . length ) . to . be . eq ( 1 ) ;
4052 expect ( meta [ 0 ] . route ) . to . be . eq ( '/derivative' ) ;
@@ -65,6 +77,18 @@ describe('controller inheritance', () => {
6577 // Build controllers
6678 const metadataBuilder = new MetadataBuilder ( { } ) ;
6779 const meta = metadataBuilder . buildControllerMetadata ( [ AutonomousController ] ) ;
80+ const storage = getMetadataArgsStorage ( ) ;
81+
82+ expect ( storage . controllers [ 0 ] . target ) . to . be . eq ( DerivativeController ) ;
83+ expect ( storage . controllers [ 0 ] . route ) . to . be . eq ( '/derivative' ) ;
84+ expect ( storage . controllers [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
85+ expect ( storage . controllers [ 1 ] . route ) . to . be . eq ( '/autonomous' ) ;
86+ expect ( storage . actions [ 0 ] . target ) . to . be . eq ( AbstractControllerTemplate ) ;
87+ expect ( storage . actions [ 0 ] . type ) . to . be . eq ( 'post' ) ;
88+ expect ( storage . actions [ 0 ] . method ) . to . be . eq ( 'create' ) ;
89+ expect ( storage . actions [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
90+ expect ( storage . actions [ 1 ] . type ) . to . be . eq ( 'post' ) ;
91+ expect ( storage . actions [ 1 ] . method ) . to . be . eq ( 'create' ) ;
6892
6993 expect ( meta . length ) . to . be . eq ( 1 ) ;
7094 expect ( meta [ 0 ] . route ) . to . be . eq ( '/autonomous' ) ;
@@ -95,6 +119,18 @@ describe('controller inheritance', () => {
95119 // Build controllers
96120 const metadataBuilder = new MetadataBuilder ( { } ) ;
97121 const meta = metadataBuilder . buildControllerMetadata ( ) ;
122+ const storage = getMetadataArgsStorage ( ) ;
123+
124+ expect ( storage . controllers [ 0 ] . target ) . to . be . eq ( DerivativeController ) ;
125+ expect ( storage . controllers [ 0 ] . route ) . to . be . eq ( '/derivative' ) ;
126+ expect ( storage . controllers [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
127+ expect ( storage . controllers [ 1 ] . route ) . to . be . eq ( '/autonomous' ) ;
128+ expect ( storage . actions [ 0 ] . target ) . to . be . eq ( DerivativeController ) ;
129+ expect ( storage . actions [ 0 ] . type ) . to . be . eq ( 'post' ) ;
130+ expect ( storage . actions [ 0 ] . method ) . to . be . eq ( 'create' ) ;
131+ expect ( storage . actions [ 1 ] . target ) . to . be . eq ( AutonomousController ) ;
132+ expect ( storage . actions [ 1 ] . type ) . to . be . eq ( 'post' ) ;
133+ expect ( storage . actions [ 1 ] . method ) . to . be . eq ( 'create' ) ;
98134
99135 expect ( meta . length ) . to . be . eq ( 2 ) ;
100136 expect ( meta [ 0 ] . actions . length ) . to . be . eq ( 1 ) ;
0 commit comments