@putout/plugin-tape 9.0.0 → 9.0.1
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.
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const {template} = require('putout');
|
|
4
4
|
|
|
5
|
-
const insertRequireTryCatch = require('../insert-require-try-catch');
|
|
6
|
-
|
|
7
5
|
module.exports.report = () => 'try-catch should be used instead of t.doesNotThrow';
|
|
8
6
|
|
|
9
7
|
module.exports.replace = () => ({
|
|
@@ -13,9 +11,7 @@ module.exports.replace = () => ({
|
|
|
13
11
|
`);
|
|
14
12
|
|
|
15
13
|
tryCatchNode.declarations[0].init.arguments[0] = __a;
|
|
16
|
-
|
|
17
14
|
path.insertBefore(tryCatchNode);
|
|
18
|
-
insertRequireTryCatch(path);
|
|
19
15
|
|
|
20
16
|
return `t.notOk(error, __b)`;
|
|
21
17
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const {template} = require('putout');
|
|
4
|
-
const insertRequireTryCatch = require('../insert-require-try-catch');
|
|
5
4
|
|
|
6
5
|
module.exports.report = () => 'try-catch should be used instead of t.throws';
|
|
7
6
|
|
|
@@ -22,8 +21,6 @@ function putTryCatch(__a, path) {
|
|
|
22
21
|
`);
|
|
23
22
|
|
|
24
23
|
tryCatchNode.declarations[0].init.arguments[0] = __a;
|
|
25
|
-
|
|
26
24
|
path.insertBefore(tryCatchNode);
|
|
27
|
-
insertRequireTryCatch(path);
|
|
28
25
|
}
|
|
29
26
|
|
package/lib/remove-skip/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const {types} = require('putout');
|
|
4
|
+
|
|
5
|
+
const {isIdentifier} = types;
|
|
6
|
+
|
|
7
|
+
module.exports.report = () => 'Remove "test.skip"';
|
|
4
8
|
|
|
5
9
|
module.exports.replace = () => ({
|
|
6
10
|
'__a.skip(__b, __c)': '__a(__b, __c)',
|
|
7
11
|
'__a.skip(__b, __c, __d)': '__a(__b, __c, __d)',
|
|
8
|
-
'__a["skip"](__b, __c)': '__a(__b, __c)',
|
|
9
12
|
});
|
|
10
13
|
|
|
11
14
|
module.exports.filter = (path) => {
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
return isIdentifier(path.node.callee.object, {
|
|
16
|
+
name: 'test',
|
|
17
|
+
});
|
|
14
18
|
};
|
|
15
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-tape",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "putout plugin helps with tests",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"c8": "^7.5.0",
|
|
36
36
|
"eslint": "^8.0.1",
|
|
37
37
|
"eslint-plugin-node": "^11.0.0",
|
|
38
|
-
"eslint-plugin-putout": "^
|
|
38
|
+
"eslint-plugin-putout": "^14.0.0",
|
|
39
39
|
"lerna": "^4.0.0",
|
|
40
40
|
"madrun": "^9.0.0",
|
|
41
41
|
"montag": "^1.2.1",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const {template} = require('putout');
|
|
4
|
-
|
|
5
|
-
const requireTryCatch = template.ast(`const tryCatch = require('try-catch')`);
|
|
6
|
-
|
|
7
|
-
module.exports = (path) => {
|
|
8
|
-
const parentScope = path.scope.getProgramParent();
|
|
9
|
-
|
|
10
|
-
if (parentScope.bindings.tryCatch)
|
|
11
|
-
return;
|
|
12
|
-
|
|
13
|
-
parentScope.block.body.unshift(requireTryCatch);
|
|
14
|
-
};
|
|
15
|
-
|