@putout/plugin-tape 16.0.0 → 17.0.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.
@@ -21,7 +21,7 @@ const {
21
21
  insertBefore,
22
22
  } = operator;
23
23
 
24
- const {ExpressionStatement} = types;
24
+ const {expressionStatement} = types;
25
25
 
26
26
  module.exports.report = () => `Call 'stopAll()' at the end of test when 'mockImport()' used`;
27
27
 
@@ -29,7 +29,7 @@ module.exports.fix = (path) => {
29
29
  const assertionPath = getAssertionsPath(path);
30
30
  const stopAllNode = template.ast('stopAll()');
31
31
 
32
- insertBefore(assertionPath, ExpressionStatement(stopAllNode));
32
+ insertBefore(assertionPath, expressionStatement(stopAllNode));
33
33
  };
34
34
 
35
35
  module.exports.traverse = ({push}) => ({
@@ -7,7 +7,7 @@ const {
7
7
  } = require('putout');
8
8
 
9
9
  const {compare, traverse} = operator;
10
- const {ExpressionStatement} = types;
10
+ const {expressionStatement} = types;
11
11
 
12
12
  module.exports.report = () => `'t.end()' is missing at the end of the test`;
13
13
 
@@ -50,6 +50,6 @@ function match({__body}, path) {
50
50
  }
51
51
 
52
52
  function replace({__body}, path) {
53
- __body.body.push(ExpressionStatement(template.ast('t.end()')));
53
+ __body.body.push(expressionStatement(template.ast('t.end()')));
54
54
  return path;
55
55
  }
@@ -19,4 +19,5 @@ module.exports.match = () => ({
19
19
 
20
20
  module.exports.replace = () => ({
21
21
  't.calledWith(__a, __b)': 't.calledWith(__a, [__b])',
22
+ 't.calledWith(__a, [...__b], __c)': 't.calledWith(__a, __b, __c)',
22
23
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- module.exports.report = () => '"calledWithNoArgs" should be used when arguments are absent';
3
+ module.exports.report = () => `Use 'calledWithNoArgs()' when arguments are absent`;
4
4
 
5
5
  module.exports.replace = () => ({
6
6
  't.calledWith(__a)': 't.calledWithNoArgs(__a)',
@@ -8,6 +8,10 @@ module.exports.replace = () => ({
8
8
  });
9
9
 
10
10
  module.exports.filter = (path) => {
11
- const {name} = path.node.callee.object;
12
- return name.startsWith('test');
11
+ const objectPath = path.get('callee.object');
12
+
13
+ if (!objectPath.isIdentifier())
14
+ return false;
15
+
16
+ return objectPath.node.name.startsWith('test');
13
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-tape",
3
- "version": "16.0.0",
3
+ "version": "17.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with tests",
@@ -27,23 +27,22 @@
27
27
  "keywords": [
28
28
  "putout",
29
29
  "putout-plugin",
30
- "plugin",
31
- "putout"
30
+ "plugin"
32
31
  ],
33
32
  "devDependencies": {
33
+ "@putout/eslint-flat": "^2.0.0",
34
34
  "@putout/plugin-putout": "*",
35
- "@putout/test": "^11.0.0",
35
+ "@putout/test": "^12.0.0",
36
36
  "c8": "^10.0.0",
37
37
  "eslint": "^9.0.0",
38
38
  "eslint-plugin-n": "^17.0.0",
39
- "eslint-plugin-putout": "^23.0.0",
40
- "lerna": "^6.0.1",
39
+ "eslint-plugin-putout": "^25.0.1",
41
40
  "madrun": "^10.0.0",
42
41
  "montag": "^1.2.1",
43
42
  "nodemon": "^3.0.1"
44
43
  },
45
44
  "peerDependencies": {
46
- "putout": ">=37"
45
+ "putout": ">=38"
47
46
  },
48
47
  "license": "MIT",
49
48
  "engines": {