@@ -14,9 +14,40 @@ import { getWrapEnumsTransformer } from './wrap-enums';
1414const transform = ( content : string ) => transformJavascript (
1515 { content, getTransforms : [ getWrapEnumsTransformer ] } ) . content ;
1616
17- // tslint:disable-next-line :no-big-function
17+ // tslint:disable:no-big-function
1818describe ( 'wrap enums and classes transformer' , ( ) => {
1919 describe ( 'wraps class declarations' , ( ) => {
20+ it ( 'should wrap tsickle emitted classes which followed by metadata' , ( ) => {
21+ const input = tags . stripIndent `
22+ class CustomComponentEffects {
23+ constructor(_actions) {
24+ this._actions = _actions;
25+ this.doThis = this._actions;
26+ }
27+ }
28+ CustomComponentEffects.decorators = [{ type: Injectable }];
29+ CustomComponentEffects.ctorParameters = () => [{ type: Actions }];
30+ tslib_1.__decorate([
31+ Effect(),
32+ tslib_1.__metadata("design:type", Object)
33+ ], CustomComponentEffects.prototype, "doThis", void 0);
34+ tslib_1.__decorate([
35+ Effect({ dispatch: false }),
36+ tslib_1.__metadata("design:type", Object)
37+ ], CustomComponentEffects.prototype, "doThat", void 0);
38+ ` ;
39+
40+ const output = tags . stripIndent `
41+ const CustomComponentEffects = /*@__PURE__*/ (() => {
42+ ${ input }
43+
44+ return CustomComponentEffects;
45+ })();
46+ ` ;
47+
48+ expect ( tags . oneLine `${ transform ( input ) } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
49+ } ) ;
50+
2051 it ( 'should ClassDeclarations that are referenced with in CallExpressions' , ( ) => {
2152 const input = tags . stripIndent `
2253 class ApplicationModule {
@@ -305,7 +336,6 @@ describe('wrap enums and classes transformer', () => {
305336 } ) ;
306337 } ) ;
307338
308- // tslint:disable-next-line:no-big-function
309339 describe ( 'wrap enums' , ( ) => {
310340 it ( 'wraps ts 2.2 enums in IIFE' , ( ) => {
311341 const input = tags . stripIndent `
0 commit comments