camel-case.test.js 427 Bytes
/**
 * 对象键名驼峰测试
 *
 * @author: jiangfeng<jeff.jiang@yoho.cn>
 * @date: 2016/05/17
 */

import {test} from 'ava';

const camelCase = require('../../library/camel-case');

test('camel case object', t => {
    let o = {
        A_B: 'ab_cd'
    };

    t.is(camelCase(o).aB, 'ab_cd');
});

test('camel case array', t => {
    let arr = [{
        A_B: 'ab_cd'
    }];

    t.is(camelCase(arr)[0].aB, 'ab_cd');
});