@@ -35,6 +35,18 @@ describe('controller inheritance', () => {
35
35
// Build controllers
36
36
const metadataBuilder = new MetadataBuilder ( { } ) ;
37
37
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' ) ;
38
50
39
51
expect ( meta . length ) . to . be . eq ( 1 ) ;
40
52
expect ( meta [ 0 ] . route ) . to . be . eq ( '/derivative' ) ;
@@ -65,6 +77,18 @@ describe('controller inheritance', () => {
65
77
// Build controllers
66
78
const metadataBuilder = new MetadataBuilder ( { } ) ;
67
79
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' ) ;
68
92
69
93
expect ( meta . length ) . to . be . eq ( 1 ) ;
70
94
expect ( meta [ 0 ] . route ) . to . be . eq ( '/autonomous' ) ;
@@ -95,6 +119,18 @@ describe('controller inheritance', () => {
95
119
// Build controllers
96
120
const metadataBuilder = new MetadataBuilder ( { } ) ;
97
121
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' ) ;
98
134
99
135
expect ( meta . length ) . to . be . eq ( 2 ) ;
100
136
expect ( meta [ 0 ] . actions . length ) . to . be . eq ( 1 ) ;
0 commit comments