@putout/plugin-tape 13.0.0 → 14.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.
- package/README.md +16 -4
- package/lib/add-t-end/index.js +6 -2
- package/lib/convert-equals-to-equal/index.js +7 -0
- package/lib/index.js +2 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ npm i @putout/plugin-tape -D
|
|
|
40
40
|
"tape/convert-called-with-no-args-to-called-with": "on",
|
|
41
41
|
"tape/convert-equal-to-called-once": "on",
|
|
42
42
|
"tape/convert-equal-to-deep-equal": "on",
|
|
43
|
+
"tape/convert-equals-to-equal": "on",
|
|
43
44
|
"tape/convert-deep-equal-to-equal": "on",
|
|
44
45
|
"tape/convert-emitter-to-promise": "on",
|
|
45
46
|
"tape/convert-ok-to-match": "on",
|
|
@@ -519,10 +520,7 @@ test('xxx', (t) => {
|
|
|
519
520
|
#### ✅ Example of correct code
|
|
520
521
|
|
|
521
522
|
```js
|
|
522
|
-
import {
|
|
523
|
-
test,
|
|
524
|
-
stub,
|
|
525
|
-
} from 'supertape';
|
|
523
|
+
import {test, stub} from 'supertape';
|
|
526
524
|
|
|
527
525
|
test('xxx', (t) => {
|
|
528
526
|
const a = stub();
|
|
@@ -712,6 +710,20 @@ t.deepEqual(error, expected);
|
|
|
712
710
|
t.end();
|
|
713
711
|
```
|
|
714
712
|
|
|
713
|
+
## convert-equals-to-equal
|
|
714
|
+
|
|
715
|
+
### ❌ Example of incorrect code
|
|
716
|
+
|
|
717
|
+
```js
|
|
718
|
+
t.equals(e.message, 'token should be a string!', 'should throw');
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
### ✅ Example of correct code
|
|
722
|
+
|
|
723
|
+
```js
|
|
724
|
+
t.equal(e.message, 'token should be a string!', 'should throw');
|
|
725
|
+
```
|
|
726
|
+
|
|
715
727
|
## convert-match-regexp-to-string
|
|
716
728
|
|
|
717
729
|
### ❌ Example of incorrect code
|
package/lib/add-t-end/index.js
CHANGED
|
@@ -7,7 +7,6 @@ const {
|
|
|
7
7
|
} = require('putout');
|
|
8
8
|
|
|
9
9
|
const {compare, traverse} = operator;
|
|
10
|
-
|
|
11
10
|
const {ExpressionStatement} = types;
|
|
12
11
|
|
|
13
12
|
module.exports.report = () => `'t.end()' is missing at the end of the test`;
|
|
@@ -37,8 +36,13 @@ function match({__body}, path) {
|
|
|
37
36
|
let found = false;
|
|
38
37
|
|
|
39
38
|
traverse(path, {
|
|
40
|
-
't.
|
|
39
|
+
'await t.__(__args)': () => {
|
|
40
|
+
found = true;
|
|
41
|
+
path.stop();
|
|
42
|
+
},
|
|
43
|
+
't.end()': (path) => {
|
|
41
44
|
found = true;
|
|
45
|
+
path.stop();
|
|
42
46
|
},
|
|
43
47
|
});
|
|
44
48
|
|
package/lib/index.js
CHANGED
|
@@ -34,6 +34,7 @@ const removeStopAll = require('./remove-stop-all');
|
|
|
34
34
|
const removeUselessTEnd = require('./remove-useless-t-end');
|
|
35
35
|
const removeOnly = require('./remove-only');
|
|
36
36
|
const removeSkip = require('./remove-skip');
|
|
37
|
+
const convertEqualsToEqual = require('./convert-equals-to-equal');
|
|
37
38
|
|
|
38
39
|
module.exports.rules = {
|
|
39
40
|
'convert-mock-require-to-mock-import': ['off', convertMockRequireToMockImport],
|
|
@@ -58,6 +59,7 @@ module.exports.rules = {
|
|
|
58
59
|
'convert-equal-to-deep-equal': convertEqualToDeepEqual,
|
|
59
60
|
'convert-equal-to-ok': convertEqualToOk,
|
|
60
61
|
'convert-equal-to-called-once': convertEqualToCalledOnce,
|
|
62
|
+
'convert-equals-to-equal': convertEqualsToEqual,
|
|
61
63
|
'convert-deep-equal-to-equal': convertDeepEqualToEqual,
|
|
62
64
|
'add-args': addArgs,
|
|
63
65
|
declare,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-tape",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.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",
|
|
@@ -31,10 +31,11 @@
|
|
|
31
31
|
"putout"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@putout/
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"eslint
|
|
34
|
+
"@putout/plugin-putout": "*",
|
|
35
|
+
"@putout/test": "^9.0.0",
|
|
36
|
+
"c8": "^9.0.0",
|
|
37
|
+
"eslint": "^9.0.0-alpha.0",
|
|
38
|
+
"eslint-plugin-n": "^17.0.0-0",
|
|
38
39
|
"eslint-plugin-putout": "^22.0.0",
|
|
39
40
|
"lerna": "^6.0.1",
|
|
40
41
|
"madrun": "^10.0.0",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"nodemon": "^3.0.1"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"putout": ">=
|
|
46
|
+
"putout": ">=35"
|
|
46
47
|
},
|
|
47
48
|
"license": "MIT",
|
|
48
49
|
"engines": {
|