@@ -110,17 +110,17 @@ describe("babel-preset-env", () => {
110
110
shouldTransformDynamicImport : false ,
111
111
shouldTransformExportNamespaceFrom : false ,
112
112
} ) ;
113
- if ( process . env . BABEL_8_BREAKING ) {
114
- expect ( names ) . toEqual ( [ "transform-modules-commonjs" ] ) ;
115
- } else {
116
- expect ( names ) . toEqual ( [
117
- "transform-modules-commonjs" ,
118
- "syntax-dynamic-import" ,
119
- "syntax-export-namespace-from" ,
120
- "syntax-top-level-await" ,
121
- "syntax-import-meta" ,
122
- ] ) ;
123
- }
113
+ expect ( names ) . toEqual (
114
+ process . env . BABEL_8_BREAKING
115
+ ? [ "transform-modules-commonjs" ]
116
+ : [
117
+ "transform-modules-commonjs" ,
118
+ "syntax-dynamic-import" ,
119
+ "syntax-export-namespace-from" ,
120
+ "syntax-top-level-await" ,
121
+ "syntax-import-meta" ,
122
+ ] ,
123
+ ) ;
124
124
} ) ;
125
125
} ) ;
126
126
describe ( "dynamic imports should be transformed" , ( ) => {
@@ -132,20 +132,17 @@ describe("babel-preset-env", () => {
132
132
shouldTransformDynamicImport : true ,
133
133
shouldTransformExportNamespaceFrom : false ,
134
134
} ) ;
135
- if ( process . env . BABEL_8_BREAKING ) {
136
- expect ( names ) . toEqual ( [
137
- "transform-modules-systemjs" ,
138
- "transform-dynamic-import" ,
139
- ] ) ;
140
- } else {
141
- expect ( names ) . toEqual ( [
142
- "transform-modules-systemjs" ,
143
- "transform-dynamic-import" ,
144
- "syntax-export-namespace-from" ,
145
- "syntax-top-level-await" ,
146
- "syntax-import-meta" ,
147
- ] ) ;
148
- }
135
+ expect ( names ) . toEqual (
136
+ process . env . BABEL_8_BREAKING
137
+ ? [ "transform-modules-systemjs" , "transform-dynamic-import" ]
138
+ : [
139
+ "transform-modules-systemjs" ,
140
+ "transform-dynamic-import" ,
141
+ "syntax-export-namespace-from" ,
142
+ "syntax-top-level-await" ,
143
+ "syntax-import-meta" ,
144
+ ] ,
145
+ ) ;
149
146
} ) ;
150
147
describe ( "export namespace from should be transformed" , ( ) => {
151
148
it ( "works" , ( ) => {
@@ -156,21 +153,21 @@ describe("babel-preset-env", () => {
156
153
shouldTransformDynamicImport : true ,
157
154
shouldTransformExportNamespaceFrom : true ,
158
155
} ) ;
159
- if ( process . env . BABEL_8_BREAKING ) {
160
- expect ( names ) . toEqual ( [
161
- "transform-modules-systemjs" ,
162
- "transform-dynamic-import " ,
163
- "transform-export-namespace-from " ,
164
- ] ) ;
165
- } else {
166
- expect ( names ) . toEqual ( [
167
- "transform-modules-systemjs" ,
168
- "transform-dynamic-import" ,
169
- "transform-export-namespace-from" ,
170
- "syntax-top-level-await" ,
171
- "syntax-import-meta" ,
172
- ] ) ;
173
- }
156
+ expect ( names ) . toEqual (
157
+ process . env . BABEL_8_BREAKING
158
+ ? [
159
+ "transform-modules-systemjs " ,
160
+ "transform-dynamic-import " ,
161
+ "transform-export-namespace-from" ,
162
+ ]
163
+ : [
164
+ "transform-modules-systemjs" ,
165
+ "transform-dynamic-import" ,
166
+ "transform-export-namespace-from" ,
167
+ "syntax-top-level-await" ,
168
+ "syntax-import-meta" ,
169
+ ] ,
170
+ ) ;
174
171
} ) ;
175
172
} ) ;
176
173
} ) ;
0 commit comments