@putout/plugin-tape 9.4.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 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.eqaul(expected, result);
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.eqaul(result, expected);
78
+ t.equal(result, expected);
72
79
  t.end();
73
80
  });
74
81
  ```
@@ -336,7 +343,7 @@ test('copymitter', async (t) => {
336
343
 
337
344
  ## apply-stub
338
345
 
339
- Apply [stub](https://github.com/cloudcmd/stub) functions created. Look how it works in [Putout Editor](https://putout.cloudcmd.io/#/gist/d098a8c8d03a072a7f3981e3cfb1d7af/f1542bfa39513ac625b2a9cd9243cc06dee286c0).
346
+ Apply [stub](https://github.com/cloudcmd/stub) functions created. Look how it works in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/d098a8c8d03a072a7f3981e3cfb1d7af/f1542bfa39513ac625b2a9cd9243cc06dee286c0).
340
347
 
341
348
  ### ❌ Example of incorrect code
342
349
 
@@ -354,7 +361,7 @@ const d = async () => {
354
361
 
355
362
  ```js
356
363
  const a = stub().resolves(true);
357
- const b = stub().resolves();
364
+ const b = stub().resolves();
358
365
 
359
366
  const c = stub().rejects(Error('hello'));
360
367
  const d = stub().rejects(Error('hello'));
@@ -463,7 +470,7 @@ mockImport('fs/promises', {
463
470
  });
464
471
  ```
465
472
 
466
- ### `tape`
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-match
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
- `supertape` will put this information for you, and it is always the same.
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
@@ -7,6 +7,12 @@ module.exports = addArgs({
7
7
  t: ['t', [
8
8
  'test("__a", (__args) => __body)',
9
9
  'test("__a", async (__args) => __body)',
10
+
11
+ 'test.only("__a", (__args) => __body)',
12
+ 'test.only("__a", async (__args) => __body)',
13
+
14
+ 'test.skip("__a", (__args) => __body)',
15
+ 'test.skip("__a", async (__args) => __body)',
10
16
  ],
11
17
  ],
12
18
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- module.exports.report = () => 't.match should be used instead of t.ok with includes';
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))',
@@ -9,5 +9,7 @@ module.exports.exclude = () => [
9
9
  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
+ 't.ok(__a.test(__b))': 't.match(__b, __a)',
13
+ 't.ok(__a.test(__b), __c)': 't.match(__b, __a, __c)',
12
14
  });
13
15
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@putout/plugin-tape",
3
- "version": "9.4.0",
3
+ "version": "9.7.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
- "description": "putout plugin helps with tests",
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,
@@ -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": "^14.0.0",
38
+ "eslint-plugin-putout": "^15.0.0",
39
39
  "lerna": "^4.0.0",
40
40
  "madrun": "^9.0.0",
41
41
  "montag": "^1.2.1",