Files
30-seconds-of-code/test/fromCamelCase/fromCamelCase.test.js
Angelos Chalaris 4f1e8b48b6 Test files linted
2018-08-03 10:39:26 +03:00

18 lines
641 B
JavaScript

const expect = require('expect');
const fromCamelCase = require('./fromCamelCase.js');
test('fromCamelCase is a Function', () => {
expect(fromCamelCase).toBeInstanceOf(Function);
});
test('Converts a string from camelcase', () => {
expect(fromCamelCase('someDatabaseFieldName', ' ')).toBe('some database field name');
});
test('Converts a string from camelcase', () => {
expect(fromCamelCase('someLabelThatNeedsToBeCamelized', '-')).toBe(
'some-label-that-needs-to-be-camelized'
);
});
test('Converts a string from camelcase', () => {
expect(fromCamelCase('someJavascriptProperty', '_')).toBe('some_javascript_property');
});