Skip to content

Commit f01a60b

Browse files
committed
feature: @putout/test: noReportCode: add
1 parent 3d5c320 commit f01a60b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

packages/test/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ test('plugin-putout: check-replace-code: no report: typescript', (t) => {
200200
});
201201
```
202202
203+
### `noReportCode(filename)`
204+
205+
Check error message of a plugin not produces
206+
207+
```js
208+
test('plugin-putout: check-replace-code: no report: import', (t) => {
209+
t.noReportCode(`import a from 'a'`);
210+
t.end();
211+
});
212+
```
213+
203214
### `noReportAfterTransform(filename)`
204215
205216
Check error message of a plugin not produced

packages/test/lib/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function createTest(dir, maybeOptions) {
129129
reportWithOptions: reportWithOptions(dir, lint, options),
130130
noReportWithOptions: noReportWithOptions(dir, lint, options),
131131
reportCode: reportCode(lint, options),
132+
noReportCode: noReportCode(lint, options),
132133
format: formatSave(dir, options),
133134
formatMany: formatManySave(dir, options),
134135
noFormat: noFormat(dir, options),

packages/test/test/report.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ test('putout: test: noReportAfterTransform', (t) => {
5353
t.end();
5454
});
5555

56+
test('putout: test: noReportCode', (t) => {
57+
t.noReportCode('const a = 5');
58+
t.end();
59+
});
60+
5661
test('putout: test: noReportWithOptions', (t) => {
5762
const cache = new Map();
5863

0 commit comments

Comments
 (0)