Files
30-seconds-of-code/test/fromCamelCase/fromCamelCase.test.js
Angelos Chalaris 4f7da1be9b Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

12 lines
576 B
JavaScript

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