@@ -7,11 +7,11 @@ pluginTester({
77 pluginName : "import-rename-codemod" ,
88 plugin : transform ,
99 snapshot : true ,
10- formatResult : output =>
10+ formatResult : ( output : any ) =>
1111 format ( output , {
1212 semi : true ,
1313 singleQuote : true ,
14- parser : "babel"
14+ parser : "babel" ,
1515 } ) ,
1616 tests : [
1717 {
@@ -23,10 +23,10 @@ pluginTester({
2323 pluginOptions : {
2424 module : {
2525 from : "one" ,
26- to : "two"
26+ to : "two" ,
2727 } ,
28- specifiers : [ "One" ]
29- } as Config
28+ specifiers : [ "One" ] ,
29+ } as Config ,
3030 } ,
3131 {
3232 title :
@@ -37,10 +37,10 @@ pluginTester({
3737 pluginOptions : {
3838 module : {
3939 from : "one" ,
40- to : "two"
40+ to : "two" ,
4141 } ,
42- specifiers : [ "Two" ]
43- } as Config
42+ specifiers : [ "Two" ] ,
43+ } as Config ,
4444 } ,
4545 {
4646 title :
@@ -51,10 +51,10 @@ pluginTester({
5151 pluginOptions : {
5252 module : {
5353 from : "one" ,
54- to : "two"
54+ to : "two" ,
5555 } ,
56- specifiers : [ "One" , "Two" ]
57- } as Config
56+ specifiers : [ "One" , "Two" ] ,
57+ } as Config ,
5858 } ,
5959 {
6060 title :
@@ -65,10 +65,10 @@ pluginTester({
6565 pluginOptions : {
6666 module : {
6767 from : "one" ,
68- to : "two"
68+ to : "two" ,
6969 } ,
70- specifiers : [ "One" , "Two" ]
71- } as Config
70+ specifiers : [ "One" , "Two" ] ,
71+ } as Config ,
7272 } ,
7373 {
7474 title : "When named to named and imports should be renamed" ,
@@ -78,13 +78,13 @@ pluginTester({
7878 pluginOptions : {
7979 module : {
8080 from : "one" ,
81- to : "two"
81+ to : "two" ,
8282 } ,
8383 specifiers : {
8484 One : "OneR" ,
85- Two : "TwoR"
86- }
87- } as Config
85+ Two : "TwoR" ,
86+ } ,
87+ } as Config ,
8888 } ,
8989 {
9090 title :
@@ -95,13 +95,13 @@ pluginTester({
9595 pluginOptions : {
9696 module : {
9797 from : "one" ,
98- to : "two"
98+ to : "two" ,
9999 } ,
100100 specifiers : {
101101 One : "OneR" ,
102- Two : "TwoR"
103- }
104- } as Config
102+ Two : "TwoR" ,
103+ } ,
104+ } as Config ,
105105 } ,
106106 {
107107 title : "When named to default should change import" ,
@@ -111,12 +111,12 @@ pluginTester({
111111 pluginOptions : {
112112 module : {
113113 from : "one" ,
114- to : "two"
114+ to : "two" ,
115115 } ,
116116 specifiers : {
117- One : "default"
118- }
119- } as Config
117+ One : "default" ,
118+ } ,
119+ } as Config ,
120120 } ,
121121 {
122122 title : "When wildcard should move all imports" ,
@@ -126,10 +126,10 @@ pluginTester({
126126 pluginOptions : {
127127 module : {
128128 from : "one" ,
129- to : "two"
129+ to : "two" ,
130130 } ,
131- specifiers : [ "*" ]
132- } as Config
131+ specifiers : [ "*" ] ,
132+ } as Config ,
133133 } ,
134134 {
135135 title : "Should move only default import" ,
@@ -139,10 +139,10 @@ pluginTester({
139139 pluginOptions : {
140140 module : {
141141 from : "one" ,
142- to : "two"
142+ to : "two" ,
143143 } ,
144- specifiers : [ "default" ]
145- } as Config
144+ specifiers : [ "default" ] ,
145+ } as Config ,
146146 } ,
147147 {
148148 title : "Should move default import and named imports" ,
@@ -152,10 +152,10 @@ pluginTester({
152152 pluginOptions : {
153153 module : {
154154 from : "one" ,
155- to : "two"
155+ to : "two" ,
156156 } ,
157- specifiers : [ "default" , "One" , "Two" ]
158- } as Config
157+ specifiers : [ "default" , "One" , "Two" ] ,
158+ } as Config ,
159159 } ,
160160 {
161161 title : "Should move default to named" ,
@@ -165,10 +165,10 @@ pluginTester({
165165 pluginOptions : {
166166 module : {
167167 from : "one" ,
168- to : "two"
168+ to : "two" ,
169169 } ,
170- specifiers : { default : "One" }
171- } as Config
170+ specifiers : { default : "One" } ,
171+ } as Config ,
172172 } ,
173173 {
174174 title : "Should move default to named while keeping others that are left" ,
@@ -178,10 +178,10 @@ pluginTester({
178178 pluginOptions : {
179179 module : {
180180 from : "one" ,
181- to : "two"
181+ to : "two" ,
182182 } ,
183- specifiers : { default : "One" }
184- } as Config
183+ specifiers : { default : "One" } ,
184+ } as Config ,
185185 } ,
186186 {
187187 title : "Should move default to named and move others along" ,
@@ -191,10 +191,10 @@ pluginTester({
191191 pluginOptions : {
192192 module : {
193193 from : "one" ,
194- to : "two"
194+ to : "two" ,
195195 } ,
196- specifiers : { default : "One" , Two : "Two" }
197- } as Config
196+ specifiers : { default : "One" , Two : "Two" } ,
197+ } as Config ,
198198 } ,
199199 {
200200 title : "Should move default to default" ,
@@ -204,10 +204,10 @@ pluginTester({
204204 pluginOptions : {
205205 module : {
206206 from : "one" ,
207- to : "two"
207+ to : "two" ,
208208 } ,
209- specifiers : [ "default" ]
210- } as Config
209+ specifiers : [ "default" ] ,
210+ } as Config ,
211211 } ,
212212 {
213213 title :
@@ -218,12 +218,12 @@ pluginTester({
218218 pluginOptions : {
219219 module : {
220220 from : "one" ,
221- to : "two"
221+ to : "two" ,
222222 } ,
223- specifiers : { One : "default" , Two : "default" }
223+ specifiers : { One : "default" , Two : "default" } ,
224224 } as Config ,
225225 error :
226- "It's impossible to make two named imports into two defaults! You should only have one 'default' value in your specifiers mapping"
226+ "It's impossible to make two named imports into two defaults! You should only have one 'default' value in your specifiers mapping" ,
227227 } ,
228228 {
229229 title : "Should fail when provided with wrong config shape" ,
@@ -233,12 +233,12 @@ pluginTester({
233233 pluginOptions : {
234234 module : {
235235 from : "one" ,
236- to : "two"
236+ to : "two" ,
237237 } ,
238- specifiers : "Wrong"
238+ specifiers : "Wrong" ,
239239 } ,
240240 error :
241- "Wrong specifiers format provided! It should be non-empty object or array."
242- }
243- ]
241+ "Wrong specifiers format provided! It should be non-empty object or array." ,
242+ } ,
243+ ] ,
244244} ) ;
0 commit comments