@putout/plugin-tape 21.11.0 → 21.13.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 +12 -0
- package/lib/add-args/index.js +10 -3
- package/lib/extract-result-from-assertion/index.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -597,6 +597,12 @@ test('xxx', (t) => {
|
|
|
597
597
|
test('xxx', () => {
|
|
598
598
|
t.end();
|
|
599
599
|
});
|
|
600
|
+
|
|
601
|
+
test('hello: world', async () => {
|
|
602
|
+
const result = await get();
|
|
603
|
+
|
|
604
|
+
deepEqual(result, []);
|
|
605
|
+
});
|
|
600
606
|
```
|
|
601
607
|
|
|
602
608
|
### ✅ Example of correct code
|
|
@@ -605,6 +611,12 @@ test('xxx', () => {
|
|
|
605
611
|
test('xxx', (t) => {
|
|
606
612
|
t.end();
|
|
607
613
|
});
|
|
614
|
+
|
|
615
|
+
test('hello: world', async ({deepEqual}) => {
|
|
616
|
+
const result = await get();
|
|
617
|
+
|
|
618
|
+
deepEqual(result, []);
|
|
619
|
+
});
|
|
608
620
|
```
|
|
609
621
|
|
|
610
622
|
## add-t-end
|
package/lib/add-args/index.js
CHANGED
|
@@ -2,6 +2,12 @@ import {operator} from 'putout';
|
|
|
2
2
|
|
|
3
3
|
const {addArgs} = operator;
|
|
4
4
|
|
|
5
|
+
const TEST_ASYNC = [
|
|
6
|
+
'test("__a", async (__args) => __body)',
|
|
7
|
+
'test.only("__a", async (__args) => __body)',
|
|
8
|
+
'test.skip("__a", async (__args) => __body)',
|
|
9
|
+
];
|
|
10
|
+
|
|
5
11
|
export const {
|
|
6
12
|
report,
|
|
7
13
|
fix,
|
|
@@ -9,10 +15,11 @@ export const {
|
|
|
9
15
|
} = addArgs({
|
|
10
16
|
t: ['t', [
|
|
11
17
|
'test("__a", (__args) => __body)',
|
|
12
|
-
'test("__a", async (__args) => __body)',
|
|
13
18
|
'test.only("__a", (__args) => __body)',
|
|
14
|
-
'test.only("__a", async (__args) => __body)',
|
|
15
19
|
'test.skip("__a", (__args) => __body)',
|
|
16
|
-
|
|
20
|
+
...TEST_ASYNC,
|
|
17
21
|
]],
|
|
22
|
+
equal: ['{equal}', TEST_ASYNC],
|
|
23
|
+
deepEqual: ['{deepEqual}', TEST_ASYNC],
|
|
24
|
+
notOk: ['{notOk}', TEST_ASYNC],
|
|
18
25
|
});
|
|
@@ -54,6 +54,10 @@ export const replace = () => ({
|
|
|
54
54
|
const result = __a(__b);
|
|
55
55
|
t.__(result);
|
|
56
56
|
}`,
|
|
57
|
+
'deepEqual(__a, __array)': `{
|
|
58
|
+
const expected = __array;
|
|
59
|
+
deepEqual(__a, expected);
|
|
60
|
+
}`,
|
|
57
61
|
't.__a(__b, __c)': ({__b, __c}, path) => {
|
|
58
62
|
const resultBinding = getBinding(path, 'result');
|
|
59
63
|
const expectedBinding = getBinding(path, 'expected');
|
package/package.json
CHANGED