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

Commit

Permalink
CLI: Test to ensure maxErrors works with stdin input
Browse files Browse the repository at this point in the history
Closes gh-851
Fixes #676
  • Loading branch information
mrjoelkemp committed Dec 22, 2014
1 parent 9aae17e commit f2496f4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,24 @@ describe('modules/cli', function() {
rAfter();
});
});

it('should display a message for input via stdin', function() {
process.stdin.isTTY = false;

var result = cli({
args: [],
config: 'test/data/cli/maxErrors.json',
maxErrors: '1'
});

process.stdin.emit('data', 'with (x) { y++; }\n');
process.stdin.emit('end');

return result.promise.always(function() {
assert(console.log.getCall(2).args[0].indexOf('Increase `maxErrors` configuration option') !== -1);
rAfter();
});
});
});

describe('errorFilter option', function() {
Expand Down

0 comments on commit f2496f4

Please sign in to comment.