2018-10-05 04:26:41 +02:00
|
|
|
import assert from 'assert'
|
2020-08-18 21:18:25 +02:00
|
|
|
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',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
tests.forEach(({ test, expected }) => {
|
|
|
|
assert.equal(utils.camelCaseToCapitalize(test), expected)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|