Skip to content

Commit d987971

Browse files
committed
fix: @putout/plugin-putout: apply-report: template
1 parent 5082d2c commit d987971

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

packages/plugin-putout/lib/apply-report/fixture/apply-report-fix.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
t.noReportWithOptions('rename-files-full', {
2-
from: ['/'],
3-
to: [],
4-
});
1+
t.noReport('rename-files-full');
52

63
t.noReport('rename-files-full');
74

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test('edit: rename-files-full: no report: equal', (t) => {
2+
t.noReport('rename-files-full');
3+
t.end();
4+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test('edit: rename-files-full: no report: equal', (t) => {
2+
t.noReport('rename-files-full', `Rename '/hello/README.md' to '/hello/abc/_README.md'`);
3+
t.end();
4+
});

packages/plugin-putout/lib/apply-report/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports.report = (path) => {
1212
const {name} = path.node.callee.property;
1313

1414
if (compare(path, 't.noReport(__a, "__b")'))
15-
return `Use 't.noReport(__a)' instead of 't.noReport(__a, "__b")'`;
15+
return `Use 't.noReport(__a)' instead of 't.noReport(__a, __b)'`;
1616

1717
if (compare(path, 't.noReportWithOptions(__a, __b, __c)'))
1818
return `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, __b, __c)'`;
@@ -22,7 +22,7 @@ module.exports.report = (path) => {
2222

2323
module.exports.replace = () => ({
2424
't.noReport(__a, __object)': 't.noReportWithOptions(__a, __object)',
25-
't.noReport(__a, "__b")': 't.noReport(__a)',
25+
't.noReport(__a, __b)': 't.noReport(__a)',
2626
't.report(__a)': 't.noReport(__a)',
2727
't.noReportWithOptions(__a)': 't.noReport(__a)',
2828
't.noReportWithOptions(__a, __b, __c)': 't.noReportWithOptions(__a, __c)',

packages/plugin-putout/lib/apply-report/index.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ test('putout: apply-report: transform: no-report-three', (t) => {
2424
t.end();
2525
});
2626

27+
test('putout: apply-report: transform: template', (t) => {
28+
t.transform('template');
29+
t.end();
30+
});
31+
2732
test('putout: apply-report: report: no-report-three', (t) => {
2833
t.report('no-report-three', `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, __b, __c)'`);
2934
t.end();
3035
});
3136

3237
test('putout: apply-report: report: no-report', (t) => {
33-
t.report('no-report', `Use 't.noReport(__a)' instead of 't.noReport(__a, "__b")'`);
38+
t.report('no-report', `Use 't.noReport(__a)' instead of 't.noReport(__a, __b)'`);
3439
t.end();
3540
});

packages/plugin-putout/test/fixture/apply-report-fix.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
t.noReportWithOptions('rename-files-full', {
2-
from: ['/'],
3-
to: [],
4-
});
1+
t.noReport('rename-files-full');
52

63
t.noReport('rename-files-full');
74

0 commit comments

Comments
 (0)