@putout/plugin-putout 22.6.0 → 22.7.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.
@@ -43,14 +43,20 @@ const check = ({__a}, path) => {
43
43
  if (FIXTURE.includes(name))
44
44
  return false;
45
45
 
46
- const str = getTestNodeArgument(name, path);
46
+ const {value} = getTestNodeArgument(path);
47
47
 
48
- return !str.value.includes(name);
48
+ if (!value)
49
+ return false;
50
+
51
+ const regEnd = RegExp(`: ${name}$`);
52
+ const regMiddle = RegExp(`: ${name}: .*`);
53
+
54
+ return !(regEnd.test(value) || regMiddle.test(value));
49
55
  };
50
56
 
51
57
  const transform = ({__a}, path) => {
52
58
  const name = __a.value;
53
- const str = getTestNodeArgument(name, path);
59
+ const str = getTestNodeArgument(path);
54
60
 
55
61
  const values = str.value.split(':');
56
62
  const last = values
@@ -65,12 +71,12 @@ const transform = ({__a}, path) => {
65
71
  return path;
66
72
  };
67
73
 
68
- const getTestNodeArgument = (value, path) => {
74
+ const getTestNodeArgument = (path) => {
69
75
  let testPath = path.find(isTest);
70
76
 
71
77
  if (!testPath)
72
78
  return {
73
- value,
79
+ value: '',
74
80
  };
75
81
 
76
82
  if (testPath.isExpressionStatement())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "22.6.0",
3
+ "version": "22.7.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",