Skip to content

Commit 7d30f7b

Browse files
committed
test: @putout/printer: coverage
1 parent c19547b commit 7d30f7b

4 files changed

Lines changed: 33 additions & 6 deletions

File tree

lib/tokenize/comment/comment.spec.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ test('printer: comments: leading: no newline', (t) => {
5050
});
5151

5252
transform(ast, source, {
53-
plugins: ['apply-destructuring'],
53+
rules: {
54+
'destructuring': 'off',
55+
'destructuring/apply-object': 'on',
56+
},
57+
plugins: ['destructuring'],
5458
});
5559

5660
const result = print(ast);
@@ -194,7 +198,11 @@ test('printer: comments-same-line-transform: transform: recast', (t) => {
194198
});
195199

196200
transform(ast, source, {
197-
plugins: ['remove-unused-variables'],
201+
rules: {
202+
'variables': 'off',
203+
'variables/remove-unused': 'on',
204+
},
205+
plugins: ['variables'],
198206
});
199207

200208
const result = print(ast);
@@ -216,7 +224,11 @@ test('printer: comments-same-line-transform: transform', (t) => {
216224
});
217225

218226
transform(ast, source, {
219-
plugins: ['remove-unused-variables'],
227+
rules: {
228+
'variables': 'off',
229+
'variables/remove-unused': 'on',
230+
},
231+
plugins: ['variables'],
220232
});
221233

222234
const result = print(ast);
@@ -319,6 +331,10 @@ test('printer: tokenize: comments: duplicate', (t) => {
319331
const ast = parse(source);
320332

321333
transform(ast, source, {
334+
rules: {
335+
'variables': 'off',
336+
'variables/remove-unused': 'on',
337+
},
322338
plugins: ['variables'],
323339
});
324340

lib/tokenize/expressions/assignment-expression/assignment-expression.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ test('printer: tokenizer: assignment-expression: no loc: putout', async (t) => {
4646

4747
await transformAsync(ast, source, {
4848
rules: {
49+
'variables': 'off',
50+
'nodejs': 'off',
4951
'nodejs/add-missing-strict-mode': 'on',
52+
'variables/remove-useless': 'on',
5053
},
51-
plugins: ['nodejs', 'remove-useless-variables'],
54+
plugins: ['nodejs', 'variables'],
5255
});
5356

5457
const result = print(ast);

lib/tokenize/expressions/object-expression/object-expression.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ test('printer: tokenizer: object-expression: comment', (t) => {
3939
const ast = parse(source);
4040

4141
transform(ast, source, {
42-
plugins: ['remove-unused-variables'],
42+
rules: {
43+
'variables': 'off',
44+
'variables/remove-unused': 'on',
45+
},
46+
plugins: ['variables'],
4347
});
4448

4549
const result = print(ast);

lib/tokenize/expressions/object-pattern/object-pattern.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ test('printer: tokenizer: object-pattern', (t) => {
1313
const ast = parse(source);
1414

1515
transform(ast, source, {
16-
plugins: ['extract-object-properties'],
16+
rules: {
17+
'destructuring': 'off',
18+
'destructuring/extract-properties': 'on',
19+
},
20+
plugins: ['destructuring'],
1721
});
1822

1923
const result = print(ast);

0 commit comments

Comments
 (0)