camel-case.test.js 457 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'
    }, {
        A_B: 'ab_cd'
    }];

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