@putout/test 11.3.1 → 11.3.3
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 +7 -7
- package/lib/eslint/eslint.mjs +7 -3
- package/lib/processor/index.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ const test = createTest(import.meta.url, {
|
|
|
63
63
|
Check error message (or messages) of a plugin:
|
|
64
64
|
|
|
65
65
|
```js
|
|
66
|
-
test('remove useless variables:
|
|
66
|
+
test('remove useless variables: dot', (t) => {
|
|
67
67
|
t.report('dot', 'Dot files should be added to .gitignore');
|
|
68
68
|
t.end();
|
|
69
69
|
});
|
|
@@ -72,7 +72,7 @@ test('remove useless variables: for-of', (t) => {
|
|
|
72
72
|
When you want to check that report called exact count of times pass an array of messages:
|
|
73
73
|
|
|
74
74
|
```js
|
|
75
|
-
test('remove useless variables:
|
|
75
|
+
test('remove useless variables: dot', (t) => {
|
|
76
76
|
t.report('dot', ['Dot files should be added to .gitignore']);
|
|
77
77
|
t.end();
|
|
78
78
|
});
|
|
@@ -94,7 +94,7 @@ test('remove debugger: report', (t) => {
|
|
|
94
94
|
Check transform of `filename.js` -> `filename-fix.js` in `test/fixtures` directory:
|
|
95
95
|
|
|
96
96
|
```js
|
|
97
|
-
test('remove useless variables:
|
|
97
|
+
test('remove useless variables: array-from', (t) => {
|
|
98
98
|
t.transform('array-from', {
|
|
99
99
|
'remove-useless-array-from': removeUselessArrayFrom,
|
|
100
100
|
});
|
|
@@ -321,12 +321,12 @@ const test = createTest(__dirname, {
|
|
|
321
321
|
'remove-console': removeConsole,
|
|
322
322
|
});
|
|
323
323
|
|
|
324
|
-
test('remove-console: report', (t) => {
|
|
324
|
+
test('remove-console: report: property-identifier', (t) => {
|
|
325
325
|
t.report('property-identifier', 'Unexpected "console" call');
|
|
326
326
|
t.end();
|
|
327
327
|
});
|
|
328
328
|
|
|
329
|
-
test('remove-console: property
|
|
329
|
+
test('remove-console: property-identifier', (t) => {
|
|
330
330
|
t.transform('property-identifier');
|
|
331
331
|
t.end();
|
|
332
332
|
});
|
|
@@ -435,7 +435,7 @@ test('eslint-config: operator-line-break', async ({comparePlaces}) => {
|
|
|
435
435
|
### `transform(name)`
|
|
436
436
|
|
|
437
437
|
```js
|
|
438
|
-
test('test: eslint: transform', (t) => {
|
|
438
|
+
test('test: eslint: transform: remove-debugger', (t) => {
|
|
439
439
|
t.transform('remove-debugger');
|
|
440
440
|
t.end();
|
|
441
441
|
});
|
|
@@ -444,7 +444,7 @@ test('test: eslint: transform', (t) => {
|
|
|
444
444
|
### `report(filename, message | []messages)`
|
|
445
445
|
|
|
446
446
|
```js
|
|
447
|
-
test('test: eslint: report', (t) => {
|
|
447
|
+
test('test: eslint: report: remove-debugger', (t) => {
|
|
448
448
|
t.report('remove-debugger', `Avoid 'debugger' statement`);
|
|
449
449
|
t.end();
|
|
450
450
|
});
|
package/lib/eslint/eslint.mjs
CHANGED
|
@@ -75,7 +75,7 @@ export const createTest = (url, plugins = {}) => {
|
|
|
75
75
|
|
|
76
76
|
return extend({
|
|
77
77
|
process: (operator) => async (name, override) => {
|
|
78
|
-
const full = join(fixtureDir, name);
|
|
78
|
+
const full = join(fixtureDir, basename(name));
|
|
79
79
|
const [resolvedName, code] = await read(full);
|
|
80
80
|
const fix = true;
|
|
81
81
|
|
|
@@ -90,12 +90,16 @@ export const createTest = (url, plugins = {}) => {
|
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
+
const fixtureName = `${full}-fix`;
|
|
94
|
+
|
|
93
95
|
if (isUpdate()) {
|
|
94
|
-
|
|
96
|
+
const fixtureNameWithExt = `${fixtureName}${extname(resolvedName)}`;
|
|
97
|
+
update(fixtureNameWithExt, source);
|
|
98
|
+
|
|
95
99
|
return operator.pass('fixture updated');
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
const [, fixture] = await read(
|
|
102
|
+
const [, fixture] = await read(fixtureName);
|
|
99
103
|
|
|
100
104
|
return operator.equal(source, fixture);
|
|
101
105
|
},
|
package/lib/processor/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
const tryToCatch = require('try-to-catch');
|
|
16
16
|
|
|
17
17
|
const test = require('supertape');
|
|
18
|
-
const processFile = require('putout/process-file');
|
|
18
|
+
const processFile = require('@putout/cli-process-file');
|
|
19
19
|
const {runProcessors} = require('@putout/engine-processor');
|
|
20
20
|
|
|
21
21
|
const isStr = (a) => typeof a === 'string';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/test",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Test runner for 🐊Putout plugins ",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"report": "madrun report"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@putout/cli-process-file": "^2.0.1",
|
|
41
42
|
"@putout/engine-processor": "*",
|
|
42
43
|
"@putout/engine-runner": "*",
|
|
43
44
|
"@putout/eslint": "^3.0.0",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"c8": "^10.0.0",
|
|
68
69
|
"eslint": "^9.0.0",
|
|
69
70
|
"eslint-plugin-n": "^17.0.0",
|
|
70
|
-
"eslint-plugin-putout": "^
|
|
71
|
+
"eslint-plugin-putout": "^24.0.0",
|
|
71
72
|
"lerna": "^6.0.1",
|
|
72
73
|
"madrun": "^10.0.0",
|
|
73
74
|
"mock-require": "^3.0.3",
|