sign.test.js 565 Bytes
/**
 * 签名类测试
 *
 * @author: jiangfeng<jeff.jiang@yoho.cn>
 * @date: 2016/05/17
 */

const test = require('ava');
const sign = require('../../library/sign');

test('app sign test', t => {
    let params = {
        client_type: 'h5', // eslint-disable-line
        a: 1,
        b: 'b'
    };
    let signedParams = sign.apiSign(params);

    t.true(sign.checkSign(signedParams));
});

test('app sign test webSign', t => {
    let params = {
        uid: '123',
        key: '3fc5a9fcea9fea49cce5432202a167ad'
    };

    t.true(sign.webSign(params));
});