@@ -56,16 +56,19 @@ export function main() {
56
56
describe ( 'Class' , ( ) => {
57
57
it ( 'should create a class' , ( ) => {
58
58
var i0 , i1 ;
59
- var MyClass = Class ( {
60
- extends : Class ( {
61
- constructor : function ( ) { } ,
62
- extendWorks : function ( ) { return 'extend ' + this . arg ; }
63
- } ) ,
64
- constructor : [ String , function ( arg ) { this . arg = arg ; } ] ,
65
- methodA : [ i0 = new Inject ( String ) , [ i1 = Inject ( String ) , Number ] , function ( a , b ) { } ] ,
66
- works : function ( ) { return this . arg ; } ,
67
- prototype : 'IGNORE'
68
- } ) ;
59
+ var MyClass =
60
+ ( < any > TestDecorator ( 'test-works' ) )
61
+ . Class ( {
62
+ extends : Class ( {
63
+ constructor : function ( ) { } ,
64
+ extendWorks : function ( ) { return 'extend ' + this . arg ; }
65
+ } ) ,
66
+ constructor : [ String , function ( arg ) { this . arg = arg ; } ] ,
67
+ methodA :
68
+ [ i0 = new Inject ( String ) , [ i1 = Inject ( String ) , Number ] , function ( a , b ) { } ] ,
69
+ works : function ( ) { return this . arg ; } ,
70
+ prototype : 'IGNORE'
71
+ } ) ;
69
72
var obj : any = new MyClass ( 'WORKS' ) ;
70
73
expect ( obj . arg ) . toEqual ( 'WORKS' ) ;
71
74
expect ( obj . works ( ) ) . toEqual ( 'WORKS' ) ;
@@ -76,6 +79,8 @@ export function main() {
76
79
var proto = ( < Function > MyClass ) . prototype ;
77
80
expect ( proto . extends ) . toEqual ( undefined ) ;
78
81
expect ( proto . prototype ) . toEqual ( undefined ) ;
82
+
83
+ expect ( reflector . annotations ( MyClass ) [ 0 ] . arg ) . toEqual ( 'test-works' )
79
84
} ) ;
80
85
81
86
describe ( 'errors' , ( ) => {
0 commit comments