2021-02-04 19:15:23 +01:00
|
|
|
import assert from 'assert';
|
|
|
|
import * as utils from './common.util';
|
2018-10-05 04:26:41 +02:00
|
|
|
|
2020-02-11 17:51:13 +01:00
|
|
|
describe('Common utils', function () {
|
|
|
|
describe('camelCaseToCapitalize', function () {
|
|
|
|
it('should return a capitalized string from a camel-cased string', function () {
|
2018-10-05 04:26:41 +02:00
|
|
|
const tests = [
|
2018-10-05 22:02:55 +02:00
|
|
|
{
|
|
|
|
test: undefined,
|
|
|
|
expected: '',
|
|
|
|
},
|
2018-10-05 04:26:41 +02:00
|
|
|
{
|
|
|
|
test: '',
|
|
|
|
expected: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: 'thisIsATest',
|
|
|
|
expected: 'This Is A Test',
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
];
|
2018-10-05 04:26:41 +02:00
|
|
|
|
|
|
|
tests.forEach(({ test, expected }) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
assert.strictEqual(utils.camelCaseToCapitalize(test), expected);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|