@ -11,6 +11,7 @@ import {
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {Component, View, Directive} from 'angular2/angular2';
|
||||
import {reflector} from 'angular2/src/reflection/reflection';
|
||||
|
||||
export function main() {
|
||||
describe('es5 decorators', () => {
|
||||
@ -24,5 +25,12 @@ export function main() {
|
||||
Component({}).View({}).View({}).Class({constructor: function() { this.works = true; }});
|
||||
expect(new MyComponent().works).toEqual(true);
|
||||
});
|
||||
|
||||
it('should create type in ES5', () => {
|
||||
function MyComponent(){};
|
||||
var as;
|
||||
(<any>MyComponent).annotations = as = Component({}).View({});
|
||||
expect(reflector.annotations(MyComponent)).toEqual(as.annotations);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user