Skip to content

Commit

Permalink
Merge aa6c06e into b84d215
Browse files Browse the repository at this point in the history
  • Loading branch information
zeezia committed Nov 30, 2018
2 parents b84d215 + aa6c06e commit 702566c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ module.exports = function(inputString) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
}
);
} else if ( typeof inputString === 'number') {
return 'Incompatible input type';
} else if ( typeof inputString === 'object') {
return 'Incompatible input type';
} else if ( typeof inputString === 'function') {
return 'Incompatible input type';
} else {
return null;
}
Expand Down
Empty file added test/abc/abc2/file2.js
Empty file.
Empty file added test/abc/file1.js
Empty file.
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe('#titlecase', function() {
var result = titlecase(testString);
expect(result).to.equal(expectedOutput);
});
it('should return null for non-string input values', function() {
it('should return appropriate message for number type input values', function() {
var testString = 1234;
var expectedOutput = null;
var expectedOutput = 'Incompatible input type';
var result = titlecase(testString);
expect(result).to.equal(expectedOutput);
});
Expand Down

0 comments on commit 702566c

Please sign in to comment.