@putout/plugin-tape 9.6.0 β 9.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.
- package/README.md +19 -5
- package/lib/convert-ok-to-match/index.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,11 +55,18 @@ npm i @putout/plugin-tape -D
|
|
|
55
55
|
|
|
56
56
|
## switch-expected-with-result
|
|
57
57
|
|
|
58
|
+
πΌ**Supertape** uses more natural way of
|
|
59
|
+
comparing: first you pass `result` and then `expected`.
|
|
60
|
+
|
|
61
|
+
It gives you ability to use value instead of `expected` and
|
|
62
|
+
understand code faster: no need to search for a second argument.
|
|
63
|
+
While `result` is always a variable, so it most likely much shorter.
|
|
64
|
+
|
|
58
65
|
### β Example of incorrect code
|
|
59
66
|
|
|
60
67
|
```js
|
|
61
68
|
test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
62
|
-
t.
|
|
69
|
+
t.equal(expected, result);
|
|
63
70
|
t.end();
|
|
64
71
|
});
|
|
65
72
|
```
|
|
@@ -68,7 +75,7 @@ test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
|
68
75
|
|
|
69
76
|
```js
|
|
70
77
|
test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
71
|
-
t.
|
|
78
|
+
t.equal(result, expected);
|
|
72
79
|
t.end();
|
|
73
80
|
});
|
|
74
81
|
```
|
|
@@ -463,7 +470,7 @@ mockImport('fs/promises', {
|
|
|
463
470
|
});
|
|
464
471
|
```
|
|
465
472
|
|
|
466
|
-
### `
|
|
473
|
+
### `test`
|
|
467
474
|
|
|
468
475
|
#### β Example of incorrect code
|
|
469
476
|
|
|
@@ -604,7 +611,7 @@ t.ok(result.includes('hello'));
|
|
|
604
611
|
t.match(result, /hello/);
|
|
605
612
|
```
|
|
606
613
|
|
|
607
|
-
## convert-ok-to-
|
|
614
|
+
## convert-ok-to-called-with
|
|
608
615
|
|
|
609
616
|
### β Example of incorrect code
|
|
610
617
|
|
|
@@ -686,7 +693,7 @@ t.match(result, 'hello');
|
|
|
686
693
|
|
|
687
694
|
## remove-default-messages
|
|
688
695
|
|
|
689
|
-
|
|
696
|
+
πΌ**Supertape** will put this information for you, and it is always the same.
|
|
690
697
|
No need to repeat the same information twice on one line, better to avoid it.
|
|
691
698
|
|
|
692
699
|
### β Example of incorrect code
|
|
@@ -742,7 +749,14 @@ test('some test', (t) => {
|
|
|
742
749
|
test.skip('some test', (t) => {
|
|
743
750
|
t.end();
|
|
744
751
|
});
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
### β
Example of correct code
|
|
745
755
|
|
|
756
|
+
```js
|
|
757
|
+
test('some test', (t) => {
|
|
758
|
+
t.end();
|
|
759
|
+
});
|
|
746
760
|
```
|
|
747
761
|
|
|
748
762
|
## remove-stop-all
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports.report = () => 't.match
|
|
3
|
+
module.exports.report = () => `Use 't.match()' instead of 't.ok()'`;
|
|
4
4
|
|
|
5
5
|
module.exports.exclude = () => [
|
|
6
6
|
't.ok(keys(__a).includes(__b))',
|
|
@@ -10,5 +10,6 @@ module.exports.replace = () => ({
|
|
|
10
10
|
't.ok(__a.includes(__b))': 't.match(__a, __b)',
|
|
11
11
|
't.ok(__a.includes(__b), __c)': 't.match(__a, __b, __c)',
|
|
12
12
|
't.ok(__a.test(__b))': 't.match(__b, __a)',
|
|
13
|
+
't.ok(__a.test(__b), __c)': 't.match(__b, __a, __c)',
|
|
13
14
|
});
|
|
14
15
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-tape",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "πPutout plugin helps with tests",
|
|
7
7
|
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-tape#readme",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"release": false,
|