Skip to content

Commit

Permalink
#2 coverage again
Browse files Browse the repository at this point in the history
  • Loading branch information
quazardous committed Jan 6, 2017
1 parent a6cd387 commit d4b676b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/readify.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ function readify(path, options, fn) {
if (typeof options.sort === 'undefined') {
options.sort = '';
}
if (typeof options.order === 'undefined') {
options.order = '';
}
if (typeof options.type === 'undefined') {
options.type = '';
}
Expand Down
17 changes: 17 additions & 0 deletions test/readify.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,23 @@ test('readify sort: size asc', (t) => {
});
});

test('readify sort: size asc raw', (t) => {
const files = [
'2.txt',
'3.txt',
'1.txt'
];

readify('./test/dir', {sort: 'size', type: 'raw'}, (error, data) => {
t.notOk(error, 'no error');
data.files = data.files.map(function(file){
return file.name;
});
t.deepEqual(data.files, files, 'correct order');
t.end();
});
});

// no comment
test('readify sort: owner', (t) => {
readify('./test/dir', {sort: 'owner'}, (error, data) => {
Expand Down

0 comments on commit d4b676b

Please sign in to comment.