Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-pranshu committed Sep 17, 2021
1 parent 50869e2 commit 8a7c43e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/grep.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,25 +183,25 @@ test('-i option', t => {
test('one directory provided with -r option', t => {
const result = shell.grep('-r', 'test', 'test/resources');
t.falsy(shell.error());
t.is(result.split('\n').length - 1, 29);
t.is(result.split('\n').length, 29);
});

test('multiple directories or files provided', t => {
const result = shell.grep('-r', 'test', 'test/resources', 'test/resources/a.txt', 'test/resources/file2.txt', 'test/utils/');
t.falsy(shell.error());
t.is(result.split('\n').length - 1, 39);
t.is(result.split('\n').length, 39);
});

test('directory provided in glob form', t => {
const result = shell.grep('-r', 'test', 'test/r*');
t.falsy(shell.error());
t.is(result.split('\n').length - 1, 66);
t.is(result.split('\n').length, 66);
});

test('works with array syntax', t => {
const result = shell.grep('-r', 'test', ['test/r*', 'package.json'], 'scripts');
t.falsy(shell.error());
t.is(result.split('\n').length - 1, 72);
t.is(result.split('\n').length, 72);
});

test('the pattern looks like an option', t => {
Expand Down

0 comments on commit 8a7c43e

Please sign in to comment.