@putout/test 6.3.0 → 6.4.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/README.md +11 -1
- package/lib/eslint/eslint.mjs +6 -2
- package/lib/test.js +24 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -323,7 +323,7 @@ test('test: eslint: transform', async ({process}) => {
|
|
|
323
323
|
});
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
### `noProcess(filename)`
|
|
326
|
+
### `noProcess(filename [, overrides])`
|
|
327
327
|
|
|
328
328
|
Check that filename would not be processed.
|
|
329
329
|
|
|
@@ -333,6 +333,16 @@ Example:
|
|
|
333
333
|
test('test: eslint: noProcess', async ({noProcess}) => {
|
|
334
334
|
await noProcess('operator-linebreak-fix');
|
|
335
335
|
});
|
|
336
|
+
|
|
337
|
+
test('test: eslint: noProcess', async ({noProcess}) => {
|
|
338
|
+
await noProcess('operator-linebreak-fix', {
|
|
339
|
+
rules: {
|
|
340
|
+
'putout/putout': ['error', {
|
|
341
|
+
printer: 'putout',
|
|
342
|
+
}],
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
});
|
|
336
346
|
```
|
|
337
347
|
|
|
338
348
|
### `comparePlaces(filename, places[, overrides])`
|
package/lib/eslint/eslint.mjs
CHANGED
|
@@ -90,15 +90,19 @@ export const createTest = (url, plugins = {}) => {
|
|
|
90
90
|
|
|
91
91
|
return operator.equal(source, fixture);
|
|
92
92
|
},
|
|
93
|
-
noProcess: (operator) => async (name) => {
|
|
93
|
+
noProcess: (operator) => async (name, overrides) => {
|
|
94
94
|
const full = join(fixtureDir, name);
|
|
95
95
|
const [resolvedName, code] = await read(full);
|
|
96
96
|
const fix = true;
|
|
97
97
|
|
|
98
98
|
const [source] = await eslint({
|
|
99
99
|
name: resolvedName,
|
|
100
|
-
config
|
|
100
|
+
config: {
|
|
101
|
+
...config,
|
|
102
|
+
...overrides,
|
|
103
|
+
},
|
|
101
104
|
code,
|
|
105
|
+
putout: true,
|
|
102
106
|
fix,
|
|
103
107
|
});
|
|
104
108
|
|
package/lib/test.js
CHANGED
|
@@ -279,16 +279,6 @@ const transform = currify((dir, options, t, name, transformed = null, addons = {
|
|
|
279
279
|
}],
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
-
if (isUpdate() && isStr) {
|
|
283
|
-
writeSourceFixture({
|
|
284
|
-
full,
|
|
285
|
-
code,
|
|
286
|
-
isTS,
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
return t.pass('source fixture updated');
|
|
290
|
-
}
|
|
291
|
-
|
|
292
282
|
if (isUpdate() && !isStr) {
|
|
293
283
|
writeFixture({
|
|
294
284
|
full,
|
|
@@ -362,7 +352,30 @@ const noTransform = currify((dir, options, t, name, addons = {}) => {
|
|
|
362
352
|
|
|
363
353
|
rmFixture(`${full}-fix`);
|
|
364
354
|
|
|
365
|
-
|
|
355
|
+
const {plugins} = options;
|
|
356
|
+
const [input, isTS] = readFixture(full);
|
|
357
|
+
|
|
358
|
+
const {code} = putout(input, {
|
|
359
|
+
printer: getPrinter(),
|
|
360
|
+
isTS,
|
|
361
|
+
...options,
|
|
362
|
+
plugins: [{
|
|
363
|
+
...toObject(plugins),
|
|
364
|
+
...addons,
|
|
365
|
+
}],
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
if (isUpdate()) {
|
|
369
|
+
writeSourceFixture({
|
|
370
|
+
full,
|
|
371
|
+
code,
|
|
372
|
+
isTS,
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
return t.pass('source fixture updated');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return t.equal(code, fixture);
|
|
366
379
|
});
|
|
367
380
|
|
|
368
381
|
const transformCode = currify((options, t, input, output, isTS = false) => {
|