Test cleanup and fixes [c-d]
This commit is contained in:
@ -5,10 +5,18 @@ const toCamelCase = require('./toCamelCase.js');
|
||||
test('toCamelCase is a Function', () => {
|
||||
expect(toCamelCase).toBeInstanceOf(Function);
|
||||
});
|
||||
t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "toCamelCase('some_database_field_name') returns someDatabaseFieldName");
|
||||
t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized");
|
||||
t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "toCamelCase('some-javascript-property') return someJavascriptProperty");
|
||||
t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens");
|
||||
test('toCamelCase('some_database_field_name') returns someDatabaseFieldName', () => {
|
||||
expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName')
|
||||
});
|
||||
test('toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized', () => {
|
||||
expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized')
|
||||
});
|
||||
test('toCamelCase('some-javascript-property') return someJavascriptProperty', () => {
|
||||
expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty')
|
||||
});
|
||||
test('toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => {
|
||||
expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens')
|
||||
});
|
||||
t.throws(() => toCamelCase(), 'toCamelCase() throws a error');
|
||||
t.throws(() => toCamelCase([]), 'toCamelCase([]) throws a error');
|
||||
t.throws(() => toCamelCase({}), 'toCamelCase({}) throws a error');
|
||||
|
||||
Reference in New Issue
Block a user