@putout/test 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/test.js +4 -10
- package/package.json +1 -1
package/lib/test.js
CHANGED
|
@@ -222,7 +222,7 @@ const formatManySave = currify((dir, options, t) => async (formatter, names, for
|
|
|
222
222
|
if (!isUpdate())
|
|
223
223
|
return await runFormat(formatter, names, formatterOptions);
|
|
224
224
|
|
|
225
|
-
const {
|
|
225
|
+
const {writeFileSync} = global.__putout_test_fs;
|
|
226
226
|
|
|
227
227
|
if (!isArray(names))
|
|
228
228
|
throw Error(`☝️ Looks like 'formatMany()' received 'names' with type: '${typeof names}', expected: 'array'`);
|
|
@@ -230,10 +230,7 @@ const formatManySave = currify((dir, options, t) => async (formatter, names, for
|
|
|
230
230
|
const name = `${names.join('-')}-format.js`;
|
|
231
231
|
const outputName = join(dir, name);
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
writeFileSync(outputName, '');
|
|
235
|
-
|
|
236
|
-
const {result} = await runFormat(formatter, names, options);
|
|
233
|
+
const {result} = await runFormat(formatter, names, formatterOptions);
|
|
237
234
|
|
|
238
235
|
writeFileSync(outputName, result);
|
|
239
236
|
|
|
@@ -246,15 +243,12 @@ const formatSave = currify((dir, options, t) => async (formatter, name, formatte
|
|
|
246
243
|
if (!isUpdate())
|
|
247
244
|
return await runFormat(formatter, name, formatterOptions);
|
|
248
245
|
|
|
249
|
-
const {
|
|
246
|
+
const {writeFileSync} = global.__putout_test_fs;
|
|
250
247
|
|
|
251
248
|
const full = join(dir, name);
|
|
252
249
|
const outputName = `${full}-format.js`;
|
|
253
250
|
|
|
254
|
-
|
|
255
|
-
writeFileSync(outputName, '');
|
|
256
|
-
|
|
257
|
-
const {result} = await runFormat(formatter, name, options);
|
|
251
|
+
const {result} = await runFormat(formatter, name, formatterOptions);
|
|
258
252
|
|
|
259
253
|
writeFileSync(outputName, result);
|
|
260
254
|
|