@putout/plugin-tape 3.4.0 → 3.5.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
|
@@ -428,6 +428,23 @@ t.match(result, RegExp('hello'));
|
|
|
428
428
|
t.match(result, 'hello');
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
+
## remove-default-messages
|
|
432
|
+
|
|
433
|
+
`supertape` will put this information for you, and it is always the same.
|
|
434
|
+
No need to repeat the same information twice on one line, better to avoid it.
|
|
435
|
+
|
|
436
|
+
### ❌ Incorrect code example
|
|
437
|
+
|
|
438
|
+
```js
|
|
439
|
+
t.equal(result, expected, 'should equal');
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### ✅ Correct code example
|
|
443
|
+
|
|
444
|
+
```js
|
|
445
|
+
t.equal(result, expected);
|
|
446
|
+
```
|
|
447
|
+
|
|
431
448
|
## License
|
|
432
449
|
|
|
433
450
|
MIT
|
|
@@ -11,16 +11,22 @@ module.exports.match = () => ({
|
|
|
11
11
|
't.match(__a, RegExp(__b), __c)': checkStr,
|
|
12
12
|
't.match(__a, /__b/)': checkRegExp,
|
|
13
13
|
't.match(__a, /__b/, __c)': checkRegExp,
|
|
14
|
+
|
|
15
|
+
't.notMatch(__a, RegExp(__b))': checkStr,
|
|
16
|
+
't.notMatch(__a, RegExp(__b), __c)': checkStr,
|
|
17
|
+
't.notMatch(__a, /__b/)': checkRegExp,
|
|
18
|
+
't.notMatch(__a, /__b/, __c)': checkRegExp,
|
|
14
19
|
});
|
|
15
20
|
|
|
16
21
|
module.exports.replace = () => ({
|
|
17
22
|
't.match(__a, RegExp(__b))': 't.match(__a, __b)',
|
|
18
23
|
't.match(__a, RegExp(__b), __c)': 't.match(__a, __b, __c)',
|
|
19
|
-
't.match(__a, /__b/)': ({__b}) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
't.
|
|
23
|
-
|
|
24
|
-
},
|
|
24
|
+
't.match(__a, /__b/)': ({__b}) => `t.match(__a, '${__b.pattern}')`,
|
|
25
|
+
't.match(__a, /__b/, __c)': ({__b}) => `t.match(__a, '${__b.pattern}', __c)`,
|
|
26
|
+
|
|
27
|
+
't.notMatch(__a, RegExp(__b))': 't.notMatch(__a, __b)',
|
|
28
|
+
't.notMatch(__a, RegExp(__b), __c)': 't.notMatch(__a, __b, __c)',
|
|
29
|
+
't.notMatch(__a, /__b/)': ({__b}) => `t.notMatch(__a, '${__b.pattern}')`,
|
|
30
|
+
't.notMatch(__a, /__b/, __c)': ({__b}) => `t.notMatch(__a, '${__b.pattern}', __c)`,
|
|
25
31
|
});
|
|
26
32
|
|
package/lib/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports.report = () => 'Avoid passing default messages to operators';
|
|
4
|
+
|
|
5
|
+
module.exports.replace = () => ({
|
|
6
|
+
't.ok(__a, "should be truthy")': 't.ok(__a)',
|
|
7
|
+
't.notOk(__a, "should be falsy")': 't.notOk(__a)',
|
|
8
|
+
't.match(__a, __b, "should match")': 't.match(__a, __b)',
|
|
9
|
+
't.notMatch(__a, __b, "should not match")': 't.notMatch(__a, __b)',
|
|
10
|
+
't.equal(__a, __b, "should equal")': 't.equal(__a, __b)',
|
|
11
|
+
't.notEqual(__a, __b, "should not equal")': 't.notEqual(__a, __b)',
|
|
12
|
+
't.deepEqual(__a, __b, "should deep equal")': 't.deepEqual(__a, __b)',
|
|
13
|
+
't.notDeepEqual(__a, __b, "should not deep equal")': 't.notDeepEqual(__a, __b)',
|
|
14
|
+
});
|
|
15
|
+
|
package/package.json
CHANGED