@@ -14,9 +14,40 @@ import { getWrapEnumsTransformer } from './wrap-enums';
14
14
const transform = ( content : string ) => transformJavascript (
15
15
{ content, getTransforms : [ getWrapEnumsTransformer ] } ) . content ;
16
16
17
- // tslint:disable-next-line :no-big-function
17
+ // tslint:disable:no-big-function
18
18
describe ( 'wrap enums and classes transformer' , ( ) => {
19
19
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
+
20
51
it ( 'should ClassDeclarations that are referenced with in CallExpressions' , ( ) => {
21
52
const input = tags . stripIndent `
22
53
class ApplicationModule {
@@ -305,7 +336,6 @@ describe('wrap enums and classes transformer', () => {
305
336
} ) ;
306
337
} ) ;
307
338
308
- // tslint:disable-next-line:no-big-function
309
339
describe ( 'wrap enums' , ( ) => {
310
340
it ( 'wraps ts 2.2 enums in IIFE' , ( ) => {
311
341
const input = tags . stripIndent `
0 commit comments