Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit f2496f4

Browse files
committed
CLI: Test to ensure maxErrors works with stdin input
Closes gh-851 Fixes #676
1 parent 9aae17e commit f2496f4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/cli.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,24 @@ describe('modules/cli', function() {
562562
rAfter();
563563
});
564564
});
565+
566+
it('should display a message for input via stdin', function() {
567+
process.stdin.isTTY = false;
568+
569+
var result = cli({
570+
args: [],
571+
config: 'test/data/cli/maxErrors.json',
572+
maxErrors: '1'
573+
});
574+
575+
process.stdin.emit('data', 'with (x) { y++; }\n');
576+
process.stdin.emit('end');
577+
578+
return result.promise.always(function() {
579+
assert(console.log.getCall(2).args[0].indexOf('Increase `maxErrors` configuration option') !== -1);
580+
rAfter();
581+
});
582+
});
565583
});
566584

567585
describe('errorFilter option', function() {

0 commit comments

Comments
 (0)