@@ -43,10 +43,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
4343 ` ,
4444 expected : `
4545 var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
46- (function (ChangeDetectionStrategy) {
47- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
48- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
49- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
46+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
47+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 0)] = "OnPush";
48+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 1)] = "Default";
5049 return ChangeDetectionStrategy;
5150 })();
5251 ` ,
@@ -64,10 +63,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
6463 ` ,
6564 expected : `
6665 export var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
67- (function (ChangeDetectionStrategy) {
68- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
69- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
70- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
66+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
67+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 0)] = "OnPush";
68+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 1)] = "Default";
7169 return ChangeDetectionStrategy;
7270 })();
7371 ` ,
@@ -85,10 +83,9 @@ describe('adjust-typescript-enums Babel plugin', () => {
8583 ` ,
8684 expected : `
8785 export var ChangeDetectionStrategy = /*#__PURE__*/ (() => {
88- (function (ChangeDetectionStrategy) {
89- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 5] = "OnPush";
90- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 8] = "Default";
91- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
86+ ChangeDetectionStrategy = ChangeDetectionStrategy || {};
87+ ChangeDetectionStrategy[(ChangeDetectionStrategy["OnPush"] = 5)] = "OnPush";
88+ ChangeDetectionStrategy[(ChangeDetectionStrategy["Default"] = 8)] = "Default";
9289 return ChangeDetectionStrategy;
9390 })();
9491 ` ,
@@ -98,20 +95,19 @@ describe('adjust-typescript-enums Babel plugin', () => {
9895 it ( 'wraps string-based TypeScript enums' , ( ) => {
9996 testCase ( {
10097 input : `
101- var NotificationKind;
102- (function (NotificationKind) {
103- NotificationKind["NEXT"] = "N";
104- NotificationKind["ERROR"] = "E";
105- NotificationKind["COMPLETE"] = "C";
106- })(NotificationKind || (NotificationKind = {}));
98+ var NotificationKind;
99+ (function (NotificationKind) {
100+ NotificationKind["NEXT"] = "N";
101+ NotificationKind["ERROR"] = "E";
102+ NotificationKind["COMPLETE"] = "C";
103+ })(NotificationKind || (NotificationKind = {}));
107104 ` ,
108105 expected : `
109106 var NotificationKind = /*#__PURE__*/ (() => {
110- (function (NotificationKind) {
111- NotificationKind["NEXT"] = "N";
112- NotificationKind["ERROR"] = "E";
113- NotificationKind["COMPLETE"] = "C";
114- })(NotificationKind || (NotificationKind = {}));
107+ NotificationKind = NotificationKind || {};
108+ NotificationKind["NEXT"] = "N";
109+ NotificationKind["ERROR"] = "E";
110+ NotificationKind["COMPLETE"] = "C";
115111 return NotificationKind;
116112 })();
117113 ` ,
@@ -165,15 +161,14 @@ describe('adjust-typescript-enums Babel plugin', () => {
165161 * @deprecated use @angular/common/http instead
166162 */
167163 var RequestMethod = /*#__PURE__*/ (() => {
168- (function (RequestMethod) {
169- RequestMethod[RequestMethod["Get"] = 0] = "Get";
170- RequestMethod[RequestMethod["Post"] = 1] = "Post";
171- RequestMethod[RequestMethod["Put"] = 2] = "Put";
172- RequestMethod[RequestMethod["Delete"] = 3] = "Delete";
173- RequestMethod[RequestMethod["Options"] = 4] = "Options";
174- RequestMethod[RequestMethod["Head"] = 5] = "Head";
175- RequestMethod[RequestMethod["Patch"] = 6] = "Patch";
176- })(RequestMethod || (RequestMethod = {}));
164+ RequestMethod = RequestMethod || {};
165+ RequestMethod[(RequestMethod["Get"] = 0)] = "Get";
166+ RequestMethod[(RequestMethod["Post"] = 1)] = "Post";
167+ RequestMethod[(RequestMethod["Put"] = 2)] = "Put";
168+ RequestMethod[(RequestMethod["Delete"] = 3)] = "Delete";
169+ RequestMethod[(RequestMethod["Options"] = 4)] = "Options";
170+ RequestMethod[(RequestMethod["Head"] = 5)] = "Head";
171+ RequestMethod[(RequestMethod["Patch"] = 6)] = "Patch";
177172 return RequestMethod;
178173 })();
179174 ` ,
0 commit comments