Skip to content

Commit

Permalink
#2 covergage stuff / add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quazardous committed Jan 6, 2017
1 parent 8e99e96 commit a6cd387
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/readify.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const sortFiles = currify((attr, order, array) => {
}
return sort((a, b) => {
var res;
if (typeof a._raw !== 'undefined' && typeof b._raw !== 'undefined' ) {
if (typeof a._raw !== 'undefined' && typeof b._raw !== 'undefined') {
res = cmp(a._raw[attr], b._raw[attr]);
} else {
res = cmp(a[attr], b[attr]);
Expand Down
15 changes: 15 additions & 0 deletions test/readify.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,21 @@ test('readify sort: size asc', (t) => {
});
});

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

test('readify sort: date', (t) => {
readify('./test/dir', {sort: 'date'}, (error, data) => {
t.notOk(error, 'no error');
t.end();
});
});

test('browser: filer', (t) => {
const Filer = {
FileSystem: sinon.stub()
Expand Down

0 comments on commit a6cd387

Please sign in to comment.